bug
This commit is contained in:
@@ -47,7 +47,8 @@ export class CategoryController {
|
||||
@ApiOperation({ summary: 'Get category' })
|
||||
@ApiOkResponse({ description: 'Category detail', type: CreateCategoryDto })
|
||||
@ApiNotFoundResponse({ description: 'Category not found' })
|
||||
findOne(@Param() id: string, @RestId() restId: string) {
|
||||
@ApiParam({ name: 'id', required: true, type: String })
|
||||
findOne(@Param('id') id: string, @RestId() restId: string) {
|
||||
return this.categoryService.findOne(restId, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,15 @@ import {
|
||||
ApiQuery,
|
||||
ApiBody,
|
||||
ApiParam,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
|
||||
import { RestId } from 'src/common/decorators';
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@ApiTags('foods')
|
||||
@Controller('foods')
|
||||
@ApiBearerAuth()
|
||||
@ApiTags('admin/foods')
|
||||
@Controller('admin/foods')
|
||||
export class FoodController {
|
||||
constructor(private readonly foodsService: FoodService) {}
|
||||
|
||||
@@ -41,7 +43,7 @@ export class FoodController {
|
||||
@ApiQuery({ name: 'order', required: false, enum: ['asc', 'desc'] })
|
||||
@ApiQuery({ name: 'categoryId', required: false, type: String })
|
||||
@ApiQuery({ name: 'isActive', required: false, type: Boolean })
|
||||
findAll(@Query() dto: FindFoodsDto,@RestId() restId: string) {
|
||||
findAll(@Query() dto: FindFoodsDto, @RestId() restId: string) {
|
||||
return this.foodsService.findAll(restId, dto);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export class FindFoodsDto {
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@ApiPropertyOptional({ example: 'cheese' })
|
||||
@ApiPropertyOptional()
|
||||
search?: string;
|
||||
|
||||
@IsOptional()
|
||||
@@ -32,7 +32,7 @@ export class FindFoodsDto {
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@ApiPropertyOptional({ example: 'category-ulid' })
|
||||
@ApiPropertyOptional()
|
||||
categoryId?: string;
|
||||
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user