fix: change password
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user