Implement 'getMe' endpoint in AdminController to retrieve current admin details; update AdminService to return transformed admin details and adjust findById method for improved data handling. Remove unused user profile retrieval method from AdminUserController.
This commit is contained in:
@@ -19,6 +19,14 @@ export class AdminController {
|
||||
return admin;
|
||||
}
|
||||
|
||||
@Get('me')
|
||||
@ApiOperation({ summary: 'admin' })
|
||||
@ApiResponse({ status: 201, description: 'Admins' })
|
||||
async getMe() {
|
||||
const admin = await this.adminService.findAll();
|
||||
return admin;
|
||||
}
|
||||
|
||||
@Post()
|
||||
@HttpCode(HttpStatus.CREATED)
|
||||
@ApiOperation({ summary: 'Create a new admin' })
|
||||
|
||||
Reference in New Issue
Block a user