Hello i have a problem with passing the formdata from angular to Nestjs. I tried to pass the values to nestjs but it didn't work. I want to mail the formdata to my email.
this is angular
sendEmail() {
const formData: any = new FormData();
formData.append('naam', this.contactFormGroup.value.naam);
formData.append('email', this.contactFormGroup.value.email);
formData.append('bericht', this.contactFormGroup.value.bericht);
console.log(formData);
this.contactService.sendMail(formData);
}
this is nestjs
@Post('sendmail')
sendMail(@Body() formdataDto: FormDataDto) {
return this.mailService.sendMail(
formdataDto.naam,
formdataDto.email,
formdataDto.bericht,
);
}