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

import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}
  @Get()
  getTest() {
    return { message: 'API is alive' };
  }
  @Post()
  async sendEMail(@Body() mailInfo: {
    name: string,
    email: string,
    phone?: string,
    company?: string,
    message: string
  }): Promise<void> {
    return await this.appService.sendMail(mailInfo);
  }
}