fix: deleteNavItem uses DELETE method instead of broken POST

This commit is contained in:
jae 2026-04-01 02:19:57 +00:00
parent ac9f18e4b9
commit c3455b34cd

View file

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