create admin

This commit is contained in:
2025-11-25 16:22:46 +03:30
parent 1d76bdcd80
commit 89ed4c90de
@@ -31,30 +31,24 @@ export class AdminController {
return admin; return admin;
} }
// @Post() @Post()
// @HttpCode(HttpStatus.CREATED) @HttpCode(HttpStatus.CREATED)
// @ApiOperation({ summary: 'Create a new admin' }) @ApiOperation({ summary: 'Create a new admin' })
// @ApiBody({ type: CreateAdminDto }) @ApiBody({ type: CreateAdminDto })
// @ApiResponse({ status: 201, description: 'Admin created' }) @ApiResponse({ status: 201, description: 'Admin created' })
// async create(@Body() dto: CreateAdminDto, @RestId() restId: string) { async create(@Body() dto: CreateAdminDto, @RestId() restId: string) {
// const admin = await this.adminService.createRestaurantBySuperAdmin({ const admin = await this.adminService.createAdminForMyRestaurant(restId, dto);
// phone: dto.phone, return admin;
// firstName: dto.firstName, }
// lastName: dto.lastName,
// roleId: dto.roleId,
// restId,
// });
// return admin;
// }
@Patch(':id') @Patch(':adminId')
@ApiOperation({ summary: 'Update an admin' }) @ApiOperation({ summary: 'Update an admin' })
@ApiParam({ name: 'id', description: 'Admin ID' }) @ApiParam({ name: 'adminId', description: 'Admin ID' })
@ApiBody({ type: UpdateAdminDto }) @ApiBody({ type: UpdateAdminDto })
@ApiResponse({ status: 200, description: 'Admin updated successfully' }) @ApiResponse({ status: 200, description: 'Admin updated successfully' })
@ApiResponse({ status: 404, description: 'Admin not found' }) @ApiResponse({ status: 404, description: 'Admin not found' })
update(@Param('id') id: string, @Body() dto: UpdateAdminDto, @RestId() restId: string): Promise<Admin> { update(@Param('adminId') adminId: string, @Body() dto: UpdateAdminDto, @RestId() restId: string): Promise<Admin> {
return this.adminService.update(id, restId, dto); return this.adminService.update(adminId, restId, dto);
} }
@Get(':adminId') @Get(':adminId')
@ApiOperation({ summary: 'Get an admin by ID' }) @ApiOperation({ summary: 'Get an admin by ID' })