From 8848259ccec2383211182d63cd87b46ba6f05a0c Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Tue, 17 Feb 2026 13:45:03 -0800 Subject: Fix feed handling: Send full feed object on update to satisfy backend requirements --- frontend-vanilla/src/main.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'frontend-vanilla/src/main.ts') diff --git a/frontend-vanilla/src/main.ts b/frontend-vanilla/src/main.ts index b826760..418b9be 100644 --- a/frontend-vanilla/src/main.ts +++ b/frontend-vanilla/src/main.ts @@ -552,11 +552,19 @@ export async function deleteFeed(id: number): Promise { } export async function updateFeed(id: number, updates: Partial): Promise { + const existing = store.feeds.find(f => f._id === id); + if (!existing) { + console.error('Feed not found in store', id); + return false; + } + + const payload = { ...existing, ...updates }; + try { const res = await apiFetch('/api/feed', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ ...updates, _id: id }) + body: JSON.stringify(payload) }); return res.ok; } catch (err) { -- cgit v1.2.3