mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-11 15:48:09 +00:00
refactor delete user endpoint
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
@ -18,6 +19,7 @@ import {
|
||||
UpdateTimezoneDataDto,
|
||||
} from '../dtos';
|
||||
import { CheckProfilePictureGuard } from 'src/guards/profile.picture.guard';
|
||||
import { SuperAdminRoleGuard } from 'src/guards/super.admin.role.guard';
|
||||
|
||||
@ApiTags('User Module')
|
||||
@Controller({
|
||||
@ -140,4 +142,17 @@ export class UserController {
|
||||
);
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Delete('/:userUuid')
|
||||
async userDelete(@Param('userUuid') userUuid: string) {
|
||||
await this.userService.deleteUser(userUuid);
|
||||
return {
|
||||
statusCode: HttpStatus.OK,
|
||||
data: {
|
||||
userUuid,
|
||||
},
|
||||
message: 'User Deleted Successfully',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user