create admin

This commit is contained in:
2025-11-22 12:52:28 +03:30
parent 8e63213f1d
commit 7a53f0fa1b
2 changed files with 4 additions and 9 deletions
@@ -13,7 +13,7 @@ import { AdminId } from 'src/common/decorators/admin-id.decorator';
export class AdminController {
constructor(private readonly adminService: AdminService) {}
@Get('my-restaurant-admins')
@Get('admins')
@ApiOperation({ summary: 'admin' })
@ApiResponse({ status: 201, description: 'Admins' })
async getAll(@RestId() restId: string) {
@@ -21,7 +21,7 @@ export class AdminController {
return admin;
}
@Get('me')
@Get('profile')
@ApiOperation({ summary: 'admin' })
@ApiResponse({ status: 201, description: 'Admins' })
async getMe(@AdminId() adminId: string) {
@@ -34,13 +34,13 @@ export class AdminController {
@ApiOperation({ summary: 'Create a new admin' })
@ApiBody({ type: CreateAdminDto })
@ApiResponse({ status: 201, description: 'Admin created' })
async create(@Body() dto: CreateAdminDto) {
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: dto.restId,
restId,
});
return admin;
}