feat(contents): add update and remove methods to contents service

- Introduced `update` method for partial content updates.
- Added `remove` method to handle content deletion.
This commit is contained in:
Mathis HERRIOT
2026-01-21 13:41:52 +01:00
parent 0382b21a65
commit b968d1e6f8

View File

@@ -66,6 +66,15 @@ export const ContentService = {
await api.delete(`/contents/${id}/admin`);
},
async update(id: string, update: Partial<Content>): Promise<Content> {
const { data } = await api.patch<Content>(`/contents/${id}`, update);
return data;
},
async remove(id: string): Promise<void> {
await api.delete(`/contents/${id}`);
},
async updateAdmin(id: string, update: Partial<Content>): Promise<Content> {
const { data } = await api.patch<Content>(`/contents/${id}/admin`, update);
return data;