fix: change password

This commit is contained in:
2025-10-09 09:01:08 +07:00
parent ad0f44669b
commit 3fd4a4c1b7
2 changed files with 21 additions and 12 deletions

View File

@@ -115,9 +115,6 @@ class UserService {
...(email && { user_email: email }),
...(phone && { user_phone: phone }),
...(role_id !== undefined && { role_id }),
...(is_sa !== undefined && { is_sa }),
...(is_active !== undefined && { is_active }),
...(is_approve !== undefined && { is_approve }),
...(updatedById !== undefined && { updated_by: updatedById })
};
@@ -163,10 +160,10 @@ class UserService {
};
// Change password
changeUserPassword = async (userId, newPassword) => {
changeUserPassword = async (user_Id, new_Password) => {
try {
const hashedPassword = await hashPassword(newPassword);
await changeUserPasswordDb(userId, hashedPassword);
const hashedPassword = await hashPassword(new_Password);
await changeUserPasswordDb(user_Id, hashedPassword);
return { message: "Password updated successfully" };
} catch (error) {
throw new ErrorHandler(error.statusCode || 500, error.message);