feat(users,professors): add promote student to professor and full student profile aggregation

This commit is contained in:
2026-08-24 22:52:38 +03:30
parent 282dd42422
commit dca7250be0
8 changed files with 401 additions and 2 deletions
+10
View File
@@ -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);