add favorit button in entry page

This commit is contained in:
X4Lo committed 2024-04-28 00:26:07 +01:00
1 parent 62056bdc98
commit 299f566b96
6 files changed
+130 -45

No files matched your search

@@ -30,17 +30,21 @@ export class EntryService {
}
// update entry
updateEntryById(entry: Entry) {
return this.http.post<Entry>(`${this.backend_apiUrl}/${this.apiAction}`, {
entry,
});
updateEntry(entry: Entry) {
return this.http.put<Entry>(
`${this.backend_apiUrl}/${this.apiAction}/${entry.id}`,
{
favorit: entry.favorit,
watchlist: entry.watchlist,
hidden: entry.hidden,
}
);
}
// update entry
refrechEntryById(entryId: number) {
return this.http.put<Entry>(
`${this.backend_apiUrl}/${this.apiAction}/${entryId}`,
[null]
return this.http.get<Entry>(
`${this.backend_apiUrl}/${this.apiAction}/${entryId}/refrech`
);
}