feat: add password change, class unenroll, and optional notify flags
Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
This commit is contained in:
@@ -17,6 +17,10 @@ exports.getSelf = catchAsync(async (req, res, next) => {
|
||||
exports.updateSelf = catchAsync(async (req, res, next) => {
|
||||
delete req.body.role;
|
||||
delete req.body.isActive;
|
||||
delete req.body.password;
|
||||
delete req.body.passwordHash;
|
||||
delete req.body.refreshTokens;
|
||||
delete req.body.username;
|
||||
|
||||
const user = await userService.updateUser(req.user._id, req.body);
|
||||
return successResponse(res, 200, 'Profile updated successfully', user);
|
||||
|
||||
Reference in New Issue
Block a user