fix: deleteNavItem uses DELETE method instead of broken POST
This commit is contained in:
parent
ac9f18e4b9
commit
c3455b34cd
1 changed files with 3 additions and 5 deletions
|
|
@ -1154,13 +1154,11 @@ const AdminApp = {
|
|||
|
||||
async deleteNavItem(index) {
|
||||
if (!confirm('Delete this navigation item?')) return;
|
||||
this.navData.splice(index, 1);
|
||||
|
||||
try {
|
||||
const res = await fetch(this.API + '/navigation', {
|
||||
method: 'POST',
|
||||
headers: this.authHeaders(),
|
||||
body: JSON.stringify({ label, url, order })
|
||||
const res = await fetch(this.API + '/navigation/' + index, {
|
||||
method: 'DELETE',
|
||||
headers: this.authHeaders()
|
||||
});
|
||||
if (!res.ok) throw new Error('Delete failed');
|
||||
this.notify('Nav item deleted');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue