Files
psp_api/src/stores/stores.controller.ts
T

35 lines
883 B
TypeScript
Raw Normal View History

import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
import { CreateStoreDto } from './dto/create-store.dto'
import { UpdateStoreDto } from './dto/update-store.dto'
import { StoresService } from './stores.service'
@Controller('stores')
export class StoresController {
constructor(private readonly storesService: StoresService) {}
@Post()
create(@Body() dto: CreateStoreDto) {
return this.storesService.create(dto)
}
@Get()
findAll() {
return this.storesService.findAll()
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.storesService.findOne(Number(id))
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateStoreDto) {
return this.storesService.update(Number(id), dto)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.storesService.remove(Number(id))
}
}