import { Controller , Get , Query , UseGuards , Post , Body } from '@nestjs/common' ; import { UserGuard } from '../../../common/guards/user.guard' ; import { SendEmailJsonDto } from '../form/send_email.dto' ; import { EmailService } from '../service/index.service' ; @ UseGuards ( UserGuard ) @ Controller ( 'email/user' ) export class UserController { constructor ( private readonly service ) { } @ Post ( '/send' ) async getTyping ( @ Body ( ) postDto ) { const data = new SendEmailJsonDto ( postDto ) ; await data . validate ( ) ; return this . service . senEmail ( postDto ) ; } }