crud product
This commit is contained in:
@@ -26,7 +26,7 @@ export class RolesController {
|
||||
@Permissions(Permission.MANAGE_ROLES)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get all through restaurant roles with pagination and filters' })
|
||||
findAll(@RestId() restId: string) {
|
||||
findAll() {
|
||||
return this.roleService.findAllGeneralAndRestaurantRoles(restId);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export class RolesController {
|
||||
@Permissions(Permission.MANAGE_ROLES)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get all permissions that the admin has' })
|
||||
async findAllPermissions(@AdminId() adminId: string, @RestId() restId: string) {
|
||||
async findAllPermissions(@AdminId() adminId: string,) {
|
||||
const adminPermissionNames = await this.permissionService.getAdminFullPermissions(adminId, restId);
|
||||
|
||||
return adminPermissionNames;
|
||||
@@ -49,7 +49,7 @@ export class RolesController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Create a new role' })
|
||||
@ApiBody({ type: CreateRoleDto })
|
||||
create(@Body() dto: CreateRoleDto, @RestId() restId: string) {
|
||||
create(@Body() dto: CreateRoleDto,) {
|
||||
return this.roleService.createRestaurantRole(dto, restId);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class RolesController {
|
||||
@Permissions(Permission.MANAGE_ROLES)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get a specific role by ID' })
|
||||
findOne(@Param('id') id: string, @RestId() restId: string) {
|
||||
findOne(@Param('id') id: string,) {
|
||||
return this.roleService.findOne(restId, id);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class RolesController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Update a role' })
|
||||
@ApiBody({ type: UpdateRoleDto })
|
||||
update(@Param('id') id: string, @Body() dto: UpdateRoleDto, @RestId() restId: string) {
|
||||
update(@Param('id') id: string, @Body() dto: UpdateRoleDto,) {
|
||||
return this.roleService.update(restId, id, dto);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class RolesController {
|
||||
@Permissions(Permission.MANAGE_ROLES)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Delete a role' })
|
||||
remove(@Param('id') id: string, @RestId() restId: string) {
|
||||
remove(@Param('id') id: string,) {
|
||||
return this.roleService.remove(restId, id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user