Angular не получается отправить dto в Rest контроллер Spring
Rest Controller принимает обьект IssueDto:
@Override
public ResponseEntity<Void> createIssue(@Valid IssueDto dto) {
AddIssueReq req = new AddIssueReq();
req.setApplicantId(dto.getApplicantId().toString());
req.setFIO(dto.getFio());
req.setPhone(dto.getPhone());
req.setSubject(dto.getSubject());
req.setDescription(dto.getDescription());
req.setEmail(dto.getEmail());
// раскомментировать и вставить в метод createIssue переменную red чтобы обращения попадали в редмайн
// Integer red = feedbackClient.sendIssue(req,file,filename,contentType);
// System.out.println(red);
return ResponseEntity.ok(pguApiService.createIssue(dto));
}
Когда я с фронта пытаюсь отправить этот обьект :
issue = {} as IssueDto;
saveIssue(value: any) {
this.isLoading = true;
this.issue.applicantId = this.applicantId
this.issue.description = value.description;
this.issue.subject = value.subject;
this.issue.email = this.applicantEmail
this.issue.phone = this.applicantPhone
this.issue.fio = this.applicantFio
this.attachment.base64file = this.file
this.attachment.contentType = this.contentType
this.attachment.name = this.filename
this.issue.formAttachment = this.attachment
this.service.createIssue(this.issue).subscribe()
this.openDialog();
this.isLoading = false;
}
В консоли получаю:
core.js:7187 ERROR
HttpErrorResponse {headers: HttpHeaders, status: 500, statusText: "Internal Server Error", url: "http://localhost:4200/rest/api/feedback/addIssue", ok: false, …}
error: {timestamp: "2020-08-18T12:57:20.083+0000", status: 500, error: "Internal Server Error", message: "status 500 reading PguApiClient#createIssue(IssueDto)", trace: "feign.FeignException$InternalServerError: status 5…va:61)↵ at java.lang.Thread.run(Thread.java:748)↵", …}
headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message: "Http failure response for http://localhost:4200/rest/api/feedback/addIssue: 500 Internal Server Error"
name: "HttpErrorResponse"
ok: false
status: 500
statusText: "Internal Server Error"
url: "http://localhost:4200/rest/api/feedback/addIssue"
__proto__: HttpResponseBase
возможно я не правильно преобразую интерфейс IssueDto в обьект ?