Spaces:
Sleeping
Sleeping
File size: 1,256 Bytes
d9eec61 2fc4f90 d9eec61 2fc4f90 d9eec61 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
} from '@nestjs/common';
import { MenuItemService } from './menu-item.service.js';
import { CreateMenuItemDto } from './dto/create-menu-item.dto.js';
import { UpdateMenuItemDto } from './dto/update-menu-item.dto.js';
import { Public } from '../authentication/authentication.decorator.js';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
@Public()
@Controller('menu-items')
export class MenuItemController {
constructor(private readonly menuItemService: MenuItemService) {}
@Post()
async create(@Body() createMenuItemDto: CreateMenuItemDto) {
return this.menuItemService.create(createMenuItemDto);
}
@Get()
async findAll(@Paginate() query: PaginateQuery) {
return this.menuItemService.findAll(query);
}
@Get(':id')
async findOne(@Param('id') id: string) {
return this.menuItemService.findOne(id);
}
@Patch(':id')
async update(
@Param('id') id: string,
@Body() updateMenuItemDto: UpdateMenuItemDto,
) {
return this.menuItemService.update(id, updateMenuItemDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.menuItemService.remove(id);
}
}
|