debug: добавлено детальное логирование отправки PATCH запроса
This commit is contained in:
parent
7fe7cc84e1
commit
8ae9753650
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user