single food
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
|
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||||
import { CategoryService } from '../providers/category.service';
|
import { CategoryService } from '../providers/category.service';
|
||||||
import { CreateCategoryDto } from '../dto/create-category.dto';
|
import { CreateCategoryDto } from '../dto/create-category.dto';
|
||||||
import { UpdateCategoryDto } from '../dto/update-category.dto';
|
import { UpdateCategoryDto } from '../dto/update-category.dto';
|
||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
ApiNotFoundResponse,
|
ApiNotFoundResponse,
|
||||||
ApiParam,
|
ApiParam,
|
||||||
ApiBody,
|
ApiBody,
|
||||||
ApiQuery,
|
|
||||||
ApiBearerAuth,
|
ApiBearerAuth,
|
||||||
ApiHeader,
|
ApiHeader,
|
||||||
} from '@nestjs/swagger';
|
} from '@nestjs/swagger';
|
||||||
|
|||||||
@@ -39,6 +39,15 @@ export class FoodController {
|
|||||||
return this.foodsService.findAllByRestaurant(slug);
|
return this.foodsService.findAllByRestaurant(slug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('public/foods/:foodId')
|
||||||
|
@ApiOperation({ summary: 'Get a food by id' })
|
||||||
|
@ApiParam({ name: 'foodId', required: true })
|
||||||
|
@ApiOkResponse({ description: 'The food', type: CreateFoodDto })
|
||||||
|
@ApiNotFoundResponse({ description: 'Food not found' })
|
||||||
|
findPublicFoodById(@Param('foodId') foodId: string) {
|
||||||
|
return this.foodsService.findById(foodId);
|
||||||
|
}
|
||||||
|
|
||||||
@UseGuards(AdminAuthGuard)
|
@UseGuards(AdminAuthGuard)
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@Post('admin/foods')
|
@Post('admin/foods')
|
||||||
|
|||||||
Reference in New Issue
Block a user