fix bug in admin

This commit is contained in:
2025-11-24 11:34:54 +03:30
parent 72c93e637c
commit e79040d81e
2 changed files with 63 additions and 53 deletions
@@ -31,21 +31,21 @@ export class AdminController {
return admin;
}
@Post()
@HttpCode(HttpStatus.CREATED)
@ApiOperation({ summary: 'Create a new admin' })
@ApiBody({ type: CreateAdminDto })
@ApiResponse({ status: 201, description: 'Admin created' })
async create(@Body() dto: CreateAdminDto, @RestId() restId: string) {
const admin = await this.adminService.createRestaurantBySuperAdmin({
phone: dto.phone,
firstName: dto.firstName,
lastName: dto.lastName,
roleId: dto.roleId,
restId,
});
return admin;
}
// @Post()
// @HttpCode(HttpStatus.CREATED)
// @ApiOperation({ summary: 'Create a new admin' })
// @ApiBody({ type: CreateAdminDto })
// @ApiResponse({ status: 201, description: 'Admin created' })
// async create(@Body() dto: CreateAdminDto, @RestId() restId: string) {
// const admin = await this.adminService.createRestaurantBySuperAdmin({
// phone: dto.phone,
// firstName: dto.firstName,
// lastName: dto.lastName,
// roleId: dto.roleId,
// restId,
// });
// return admin;
// }
@Patch(':id')
@ApiOperation({ summary: 'Update an admin' })