ERROR Error Code: 500
Message: Http failure response for http://localhost:4000/api/update/5de40f285e9c793ed4af996c: 500 Internal Server Error
изображение один - API-сервис
Первый блоккод от службы API, и 2-й блок - компонент редактирования
UpdateStudent(id, data: Student): Observable<any> {
let API_URL = `${this.endpoint}/update/${id}`;
return this.http.put(API_URL, data, { headers: this.headers }).pipe(
catchError(this.errorMgmt)
)
}
код службы API
updateStudentForm() {
console.log(this.studentForm.value)
var id = this.actRoute.snapshot.paramMap.get('id');
if (window.confirm('Are you sure you want to update?')) {
this.studentApi.UpdateStudent(id, this.studentForm.value).subscribe(res => {
this.ngZone.run(() => this.router.navigateByUrl('/students-list'))
});
}
}
}