feat(users,professors): add promote student to professor and full student profile aggregation
This commit is contained in:
@@ -9,6 +9,12 @@ exports.create = catchAsync(async (req, res, next) => {
|
||||
return successResponse(res, 201, 'Professor created successfully', professor);
|
||||
});
|
||||
|
||||
exports.createFromUser = catchAsync(async (req, res, next) => {
|
||||
const userId = req.body.userId || req.params.userId || req.body.id;
|
||||
const result = await professorService.createProfessorFromUser(userId, req.body);
|
||||
return successResponse(res, 201, 'Professor created from user successfully', result);
|
||||
});
|
||||
|
||||
exports.getOne = catchAsync(async (req, res, next) => {
|
||||
const professor = await professorService.getProfessorById(req.params.id);
|
||||
return successResponse(res, 200, 'Professor retrieved successfully', professor);
|
||||
|
||||
Reference in New Issue
Block a user