I have a project in Angular and Spring in which I am implementing CRUD operations but I am having trouble updating the fields in the database.
My problem: how can I communicate the ts function with the service to send the new data to the back and update the database?
This is my service.ts with the edit function:
public edit(cliente: Cliente): Observable<Cliente> {
console.log('edit: ' + `${PREFIX}/${cliente.id}`, cliente);
return this.http.post<Cliente>(`${PREFIX}/${cliente.id}`, cliente);
}
This is the function that I currently have in the ts to save the changes but I don't know how to communicate it with the service to send it the new data:
saveEdit() {
this.editIndex = -1;
}