feat: PantryItem (Baslager) - tabell, backend-modul och frontend-sida
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Post } from '@nestjs/common';
|
||||
import { PantryService } from './pantry.service';
|
||||
import { CreatePantryItemDto } from './dto/create-pantry-item.dto';
|
||||
|
||||
@Controller('pantry')
|
||||
export class PantryController {
|
||||
constructor(private readonly pantryService: PantryService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.pantryService.findAll();
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() body: CreatePantryItemDto) {
|
||||
return this.pantryService.create(body);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.pantryService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user