Newer
Older
import { Controller, Post, Body } from '@nestjs/common';
import { ContactForm } from './email';
import { EmailService } from './email.service';
import { ApiBadRequestResponse, ApiOkResponse } from '@nestjs/swagger';
@Controller('email')
export class EmailController {
constructor(
private emailService: EmailService,
) {}
@ApiOkResponse({ description: 'OK'})
@ApiBadRequestResponse({ description: 'Missing fields'})
create(@Body() contactForm: ContactForm) {
return this.emailService.send(contactForm);