mirror of
https://github.com/Floriansylvain/snippets-manager-front.git
synced 2026-08-20 03:53:38 +02:00
feat: category delete
This commit is contained in:
@@ -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 }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user