diff --git a/js/admin.js b/js/admin.js index ca8b1c4..bf43e78 100644 --- a/js/admin.js +++ b/js/admin.js @@ -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');