diff --git a/src/modules/foods/controllers/category.controller.ts b/src/modules/foods/controllers/category.controller.ts index d0ff8b3..b0cb62f 100644 --- a/src/modules/foods/controllers/category.controller.ts +++ b/src/modules/foods/controllers/category.controller.ts @@ -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); } diff --git a/src/modules/foods/controllers/food.controller.ts b/src/modules/foods/controllers/food.controller.ts index e1d1454..c440beb 100644 --- a/src/modules/foods/controllers/food.controller.ts +++ b/src/modules/foods/controllers/food.controller.ts @@ -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); } diff --git a/src/modules/foods/dto/find-foods.dto.ts b/src/modules/foods/dto/find-foods.dto.ts index 31e339f..19cb94a 100644 --- a/src/modules/foods/dto/find-foods.dto.ts +++ b/src/modules/foods/dto/find-foods.dto.ts @@ -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()