create admin
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user