update handle reject & is_active

This commit is contained in:
2025-10-16 11:30:00 +07:00
parent 77a89489cd
commit 172e14e77d
3 changed files with 84 additions and 27 deletions

View File

@@ -219,6 +219,8 @@ const DetailUser = (props) => {
if (FormData.user_email !== originalEmail) {
payload.user_email = FormData.user_email;
}
// Add is_active for update mode
payload.is_active = FormData.is_active;
} else {
// For create mode: always send email
payload.user_email = FormData.user_email;
@@ -233,11 +235,11 @@ const DetailUser = (props) => {
if (!FormData.user_id) {
payload.user_name = FormData.user_name; // Username only for create
payload.user_password = FormData.password; // Backend expects 'user_password'
// Don't send confirmPassword, is_sa, is_active for create
// Don't send confirmPassword, is_sa for create
}
// For update mode:
// - Don't send 'user_name' (username is immutable)
// - Don't send 'is_active' (backend validation schema doesn't allow it)
// - is_active is now sent for update mode
// - Only send email if it has changed
try {