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:
@@ -66,6 +66,15 @@ export const ContentService = {
|
|||||||
await api.delete(`/contents/${id}/admin`);
|
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> {
|
async updateAdmin(id: string, update: Partial<Content>): Promise<Content> {
|
||||||
const { data } = await api.patch<Content>(`/contents/${id}/admin`, update);
|
const { data } = await api.patch<Content>(`/contents/${id}/admin`, update);
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in New Issue
Block a user