mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-31 02:39:38 +02:00
fix: update deleteAdventure function to use DELETE method for API call
This commit is contained in:
parent
f4450b6a38
commit
0cee4c386d
1 changed files with 2 additions and 5 deletions
|
@ -60,11 +60,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteAdventure() {
|
async function deleteAdventure() {
|
||||||
let res = await fetch(`/adventures/${adventure.id}?/delete`, {
|
let res = await fetch(`/api/adventures/${adventure.id}`, {
|
||||||
method: 'POST',
|
method: 'DELETE'
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
addToast('info', $t('adventures.adventure_delete_success'));
|
addToast('info', $t('adventures.adventure_delete_success'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue