catalogue
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
|
||||
import { CatalogueService } from './catalogue.service';
|
||||
import { CreateCatalogueDto } from './dto/create-catalogue.dto';
|
||||
import { UpdateCatalogueDto } from './dto/update-catalogue.dto';
|
||||
import { FindCataloguesDto } from './dto/find-catalogues.dto';
|
||||
|
||||
@Controller('catalogue')
|
||||
export class CatalogueController {
|
||||
constructor(private readonly catalogueService: CatalogueService) {}
|
||||
constructor(private readonly catalogueService: CatalogueService) { }
|
||||
|
||||
@Post()
|
||||
create(@Body() createCatalogueDto: CreateCatalogueDto) {
|
||||
@@ -13,22 +14,22 @@ export class CatalogueController {
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.catalogueService.findAll();
|
||||
findAll(@Query() queryDto: FindCataloguesDto) {
|
||||
return this.catalogueService.findAll(queryDto);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.catalogueService.findOne(+id);
|
||||
return this.catalogueService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateCatalogueDto: UpdateCatalogueDto) {
|
||||
return this.catalogueService.update(+id, updateCatalogueDto);
|
||||
return this.catalogueService.update(id, updateCatalogueDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.catalogueService.remove(+id);
|
||||
return this.catalogueService.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user