mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 05:49:37 +02:00
Refactor deleteCollection function to use DELETE method for API call; update endpoint to match new API structure.
This commit is contained in:
parent
57aa2c9916
commit
56b8b55b84
3 changed files with 21 additions and 292 deletions
|
@ -54,11 +54,8 @@
|
|||
export let collection: Collection;
|
||||
|
||||
async function deleteCollection() {
|
||||
let res = await fetch(`/collections/${collection.id}?/delete`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
let res = await fetch(`/api/collections/${collection.id}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
if (res.ok) {
|
||||
addToast('info', $t('adventures.delete_collection_success'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue