Add update functionality for recipes and create edit page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Post, Patch } from '@nestjs/common';
|
||||
import { RecipesService } from './recipes.service';
|
||||
import { CreateRecipeDto } from './dto/create-recipe.dto';
|
||||
|
||||
@@ -25,4 +25,12 @@ export class RecipesController {
|
||||
async create(@Body() createRecipeDto: CreateRecipeDto) {
|
||||
return this.recipesService.create(createRecipeDto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(
|
||||
@Param('id', ParseIntPipe) id: number,
|
||||
@Body() createRecipeDto: CreateRecipeDto,
|
||||
) {
|
||||
return this.recipesService.update(id, createRecipeDto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user