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:
@@ -31,10 +31,15 @@ exports.delete = catchAsync(async (req, res) => {
|
||||
});
|
||||
|
||||
exports.registerUsers = catchAsync(async (req, res) => {
|
||||
const cls = await classService.registerUsers(req.params.id, req.body.userIds || []);
|
||||
const cls = await classService.registerUsers(req.params.id, req.body.userIds || [], req.body);
|
||||
return successResponse(res, 200, 'Users registered in class successfully', cls);
|
||||
});
|
||||
|
||||
exports.removeUser = catchAsync(async (req, res) => {
|
||||
const cls = await classService.removeUser(req.params.id, req.params.userId);
|
||||
return successResponse(res, 200, 'User removed from class successfully', cls);
|
||||
});
|
||||
|
||||
exports.getMyClasses = catchAsync(async (req, res) => {
|
||||
const { data, meta } = await classService.getMyClasses(req.user._id, req.query);
|
||||
return listResponse(res, 200, data, meta);
|
||||
|
||||
Reference in New Issue
Block a user