Spaces:
Runtime error
Runtime error
| import { | |
| Controller, | |
| Get, | |
| Post, | |
| Body, | |
| Patch, | |
| Param, | |
| Delete, | |
| } from '@nestjs/common'; | |
| import { CustomerService } from './customer.service'; | |
| import { CustomerDto } from '@bpm/data/dto/customer/customer.dto'; | |
| import { UpdateCustomerDto } from '@bpm/data/dto/customer/update-customer.dto'; | |
| (['customer', 'customers']) | |
| export class CustomerController { | |
| constructor(private readonly customerService: CustomerService) {} | |
| () | |
| create(() createCustomerDto: CustomerDto) { | |
| //console.log('Creating customer with data:', createCustomerDto); | |
| return this.customerService.create(createCustomerDto); | |
| } | |
| () | |
| findAll() { | |
| //console.log('Fetching all customers'); | |
| return this.customerService.findAll(); | |
| } | |
| (':id') | |
| findOne(('id') id: string) { | |
| return this.customerService.findOne(id); | |
| } | |
| (':id') | |
| update( | |
| ('id') id: string, | |
| () updateCustomerDto: UpdateCustomerDto, | |
| ) { | |
| return this.customerService.update(id, updateCustomerDto); | |
| } | |
| (':id') | |
| remove(('id') id: string) { | |
| return this.customerService.remove(id); | |
| } | |
| } | |