mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 03:09:32 -06:00
fix user service
This commit is contained in:
@@ -464,10 +464,10 @@ class AuthController extends BaseController {
|
||||
}
|
||||
|
||||
const userId = req.params.userId;
|
||||
const updates = { ...req.body };
|
||||
await editUserByIdParamValidation.validateAsync(req.params);
|
||||
await editUserPasswordByIdBodyValidation.validateAsync(req.body);
|
||||
await this.userService.setPasswordByUserId(userId, updates);
|
||||
const updatedPassword = req.body.password;
|
||||
await this.userService.setPasswordByUserId(userId, updatedPassword);
|
||||
return res.success({ msg: "Password reset successfully" });
|
||||
},
|
||||
SERVICE_NAME,
|
||||
|
||||
@@ -212,7 +212,7 @@ class UserService {
|
||||
await this.db.userModule.editUserById(userId, user);
|
||||
};
|
||||
setPasswordByUserId = async (userId, updates) => {
|
||||
const updatedUser = await this.db.userModule.updateUser({ userId: userId, user: updates, file: null });
|
||||
const updatedUser = await this.db.userModule.updateUser({ userId: userId, user: { password: updates }, file: null });
|
||||
return updatedUser;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user