feat: Add account deletion functionality for both agents and regular users.
This commit is contained in:
@@ -227,6 +227,19 @@ export class AgentsController {
|
||||
return this.agentsService.updatePrivacyPreferences(userId, data);
|
||||
}
|
||||
|
||||
// Delete account endpoint
|
||||
|
||||
@Delete('account')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.AGENT)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Delete agent account permanently (Agents only)' })
|
||||
@ApiResponse({ status: 200, description: 'Account deleted successfully' })
|
||||
@ApiResponse({ status: 404, description: 'User not found' })
|
||||
async deleteAccount(@CurrentUser('id') userId: string) {
|
||||
return this.agentsService.deleteAccount(userId);
|
||||
}
|
||||
|
||||
// Public parameterized routes - MUST come after specific routes like profile/*
|
||||
@Get(':id')
|
||||
@Public()
|
||||
|
||||
Reference in New Issue
Block a user