From 7518e6f81e4d620e63bfc65b405ea55f5b015901 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 19:21:28 +0000 Subject: [PATCH] Add "Reissue an article" panel to the Retention admin tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires up POST /api/admin/articles/:id/reissue (added alongside the blank-article fix) as a UI panel instead of requiring curl: paste an article ID, it deletes the article and requeues its source items for re-publish. Verified live in a browser against a real backend/DB — both the success path and the "no article with that ID" 404 case. --- frontend/src/lib/adminApi.ts | 5 ++ .../lib/components/admin/RetentionTab.svelte | 61 ++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/adminApi.ts b/frontend/src/lib/adminApi.ts index bc963f9..a95bdb6 100644 --- a/frontend/src/lib/adminApi.ts +++ b/frontend/src/lib/adminApi.ts @@ -107,6 +107,11 @@ export const pollSourceNow = (id: string, fetchFn?: typeof fetch) => export const reissueSourceContent = (id: string, fetchFn?: typeof fetch) => request<{ articlesDeleted: number; itemsRequeued: number }>(`/api/admin/sources/${id}/reissue`, { method: 'POST' }, fetchFn); +// Fixes one specific bad article regardless of how many sources it merged — unlike +// reissueSourceContent above, which deliberately won't touch a multi-source article. +export const reissueArticle = (id: string, fetchFn?: typeof fetch) => + request<{ articlesDeleted: number; itemsRequeued: number }>(`/api/admin/articles/${id}/reissue`, { method: 'POST' }, fetchFn); + // Content clearing — wipe articles/media/a source's raw items so they can be repopulated fresh. export const clearSourceContent = (id: string, fetchFn?: typeof fetch) => request<{ itemsDeleted: number; articlesDeleted: number }>(`/api/admin/content/sources/${id}`, { method: 'DELETE' }, fetchFn); diff --git a/frontend/src/lib/components/admin/RetentionTab.svelte b/frontend/src/lib/components/admin/RetentionTab.svelte index f2a1058..b583620 100644 --- a/frontend/src/lib/components/admin/RetentionTab.svelte +++ b/frontend/src/lib/components/admin/RetentionTab.svelte @@ -1,6 +1,6 @@