import { Body, Controller, Post } from '@nestjs/common';

import { Public } from '../public.decorator';
import { ContactForm } from './contact-form.interface';
import { EmailService } from './email.service';

@Controller('email')
export class EmailController {
  constructor(private readonly $emailService: EmailService) {}

  @Post('contact-form')
  @Public()
  public async sendContactForm(@Body() form: ContactForm) {
    await this.$emailService.sendContactForm(form);
  }
}
