fix(profile): make save button work and verify current password

This commit is contained in:
dev
2026-10-22 17:30:08 +03:00
parent 0ecbca5f13
commit af67526df7
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -342,7 +342,10 @@
if (data.name !== undefined) body.name = data.name;
if (data.email !== undefined) body.email = data.email;
if (data.phone !== undefined) body.phone = data.phone;
if (data.password) body.password = data.password;
if (data.password) {
body.password = data.password;
body.old_password = data.oldPassword;
}
setLoading(els.btnSave, true);
clearErrors();
@@ -903,6 +906,7 @@
if (!isPasswordVisible) setDirty('general', generalSnapshot() !== generalBaseline);
});
els.btnSave.addEventListener('click', saveProfile);
els.btnCancel.addEventListener('click', () => { loadProfile(); });
els.btnLogout.addEventListener('click', () => { doLogout(); });