1
0
Fork 0
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:
Sean Morley 2025-05-27 12:39:38 -04:00
parent 57aa2c9916
commit 56b8b55b84
3 changed files with 21 additions and 292 deletions

View file

@ -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'));