fix: hash password for change user password

This commit is contained in:
2025-10-15 11:14:32 +07:00
parent 32d25cef6a
commit 7e05fc589b

View File

@@ -144,7 +144,8 @@ class UserService {
const userExist = await getUserByIdDb(id);
if (!userExist) throw new ErrorHandler(404, 'User not found');
const result = await changeUserPasswordDb(id, newPassword);
const hashedPassword = await hashPassword(newPassword);
const result = await changeUserPasswordDb(id, hashedPassword);
return result;
} catch (error) {
throw new ErrorHandler(error.statusCode, error.message);