Recipe-app main
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Post } from '@nestjs/common';
|
||||
import { CreateRecipeDto } from './dto/create-recipe.dto';
|
||||
import { RecipesService } from './recipes.service';
|
||||
|
||||
@Controller('recipes')
|
||||
export class RecipesController {
|
||||
constructor(private readonly recipesService: RecipesService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.recipesService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id/inventory-preview')
|
||||
getInventoryPreview(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.recipesService.getInventoryPreview(id);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.recipesService.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() body: CreateRecipeDto) {
|
||||
return this.recipesService.create(body);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user