feat(users,professors): add promote student to professor and full student profile aggregation
This commit is contained in:
@@ -36,6 +36,16 @@ exports.getOne = catchAsync(async (req, res, next) => {
|
||||
return successResponse(res, 200, 'User retrieved successfully', user);
|
||||
});
|
||||
|
||||
exports.getFullProfile = catchAsync(async (req, res, next) => {
|
||||
const profile = await userService.getUserFullProfile(req.params.id);
|
||||
return successResponse(res, 200, 'User full profile retrieved successfully', profile);
|
||||
});
|
||||
|
||||
exports.promoteToProfessor = catchAsync(async (req, res, next) => {
|
||||
const result = await userService.promoteToProfessor(req.params.id, req.body);
|
||||
return successResponse(res, 200, 'User promoted to professor successfully', result);
|
||||
});
|
||||
|
||||
exports.getAll = catchAsync(async (req, res, next) => {
|
||||
const { data, meta } = await userService.getAllUsers(req.query);
|
||||
return listResponse(res, 200, data, meta);
|
||||
|
||||
Reference in New Issue
Block a user