refactor delete user endpoint

This commit is contained in:
faris Aljohari
2024-09-30 02:10:41 -05:00
parent a3cce2b21c
commit 2b9788eff7
4 changed files with 26 additions and 28 deletions

View File

@ -1,10 +1,8 @@
import {
Body,
Controller,
Delete,
Get,
HttpStatus,
Param,
Post,
Req,
UseGuards,
@ -51,20 +49,6 @@ export class UserAuthController {
};
}
@ApiBearerAuth()
@UseGuards(SuperAdminRoleGuard)
@Delete('user/delete/:id')
async userDelete(@Param('id') id: string) {
await this.userAuthService.deleteUser(id);
return {
statusCode: HttpStatus.OK,
data: {
id,
},
message: 'User Deleted Successfully',
};
}
@Post('user/send-otp')
async sendOtp(@Body() otpDto: UserOtpDto) {
const otpCode = await this.userAuthService.generateOTP(otpDto);