igcrmapi/src/quotes/quotes.controller.ts

40 lines
1.0 KiB
TypeScript

import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { QuotesService } from './quotes.service';
import { CreateQuoteDto } from './dto/create-quote.dto';
import { UpdateQuoteDto } from './dto/update-quote.dto';
@Controller('quotes')
export class QuotesController {
constructor(private readonly quotesService: QuotesService) { }
@Post()
create(@Body() createQuoteDto: CreateQuoteDto) {
return this.quotesService.create(createQuoteDto);
}
@Get()
findAll() {
return this.quotesService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.quotesService.findOne(id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateQuoteDto: UpdateQuoteDto) {
return this.quotesService.update(id, updateQuoteDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.quotesService.remove(id);
}
@Post(':id/send')
send(@Param('id') id: string, @Body('type') type: 'whatsapp' | 'email') {
return this.quotesService.send(id, type);
}
}