diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-17 13:45:03 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-17 13:45:03 -0800 |
| commit | 8848259ccec2383211182d63cd87b46ba6f05a0c (patch) | |
| tree | 0088be560bed00c644e8435661c51d45f627c391 /frontend-vanilla/src/main.ts | |
| parent | c3b7c28c79f0db94cd09d3ba218340e8e26e1758 (diff) | |
| download | neko-8848259ccec2383211182d63cd87b46ba6f05a0c.tar.gz neko-8848259ccec2383211182d63cd87b46ba6f05a0c.tar.bz2 neko-8848259ccec2383211182d63cd87b46ba6f05a0c.zip | |
Fix feed handling: Send full feed object on update to satisfy backend requirements
Diffstat (limited to 'frontend-vanilla/src/main.ts')
| -rw-r--r-- | frontend-vanilla/src/main.ts | 10 |
1 files changed, 9 insertions, 1 deletions
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<boolean> { } export async function updateFeed(id: number, updates: Partial<Feed>): Promise<boolean> { + 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) { |
