feat: category delete

This commit is contained in:
Florian Sylvain
2024-10-10 23:12:18 +02:00
parent ec9bc1bb4b
commit 6e085a34ab
4 changed files with 59 additions and 11 deletions
+8 -1
View File
@@ -16,5 +16,12 @@ export const useCategoriesStore = defineStore('categories', () => {
})
}
return { getCategories, postCategory }
const deleteCategory = async (id: number): Promise<Response> => {
return await fetch(`${api.url}/category/${id}`, {
...api.options,
method: 'DELETE'
})
}
return { getCategories, postCategory, deleteCategory }
})