From 3562852d840c6f9308529e6d400a6fae94619475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=9D=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Mon, 1 Dec 2025 15:10:02 +0300 Subject: [PATCH] =?UTF-8?q?debug:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B4=D0=B5=D1=82=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20PATCH=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/static/js/components/employeeFormHandler.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/static/js/components/employeeFormHandler.js b/backend/static/js/components/employeeFormHandler.js index e85fcc04..7ae070c4 100644 --- a/backend/static/js/components/employeeFormHandler.js +++ b/backend/static/js/components/employeeFormHandler.js @@ -224,6 +224,7 @@ export function initEmployeeForm(options = {}) { // Если нечего отправлять — просто обновим UI if (Object.keys(payload).length === 0 && !avatarFile) { + console.log('[EmployeeForm] Nothing to save, reloading...'); setSubmitting(false); if (window.bootstrap) { try { @@ -234,12 +235,18 @@ export function initEmployeeForm(options = {}) { return; } + console.log('[EmployeeForm] Sending PATCH request to:', endpoint); + console.log('[EmployeeForm] Headers:', headers); + console.log('[EmployeeForm] Body type:', body instanceof FormData ? 'FormData' : typeof body); + const resp = await fetch(endpoint, { method: 'PATCH', headers: headers, body: body, credentials: 'same-origin' }); + + console.log('[EmployeeForm] Response status:', resp.status, resp.statusText); if (!resp.ok) { let body = null;