From 12cc81905ea982ba46c3cc0af7da548a34a72562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Thu, 4 Dec 2025 12:31:49 +0100 Subject: [PATCH] Tighten admin specials handling and remove obsolete curate button --- app/admin/page.tsx | 53 +++++++++++++++++++++++--------- app/admin/specials/[id]/page.tsx | 8 ++++- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 6aab3b8..133d976 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -638,20 +638,45 @@ export default function AdminPage() {
{specials.map(special => ( -
- {special.name} ({special._count?.songs || 0}) - {special.subtitle && - {special.subtitle}} - Curate - - +
+ + {special.name} ({special._count?.songs || 0}) + + {special.subtitle && ( + + - {special.subtitle} + + )} + +
))}
diff --git a/app/admin/specials/[id]/page.tsx b/app/admin/specials/[id]/page.tsx index 8fa671e..1890e51 100644 --- a/app/admin/specials/[id]/page.tsx +++ b/app/admin/specials/[id]/page.tsx @@ -36,11 +36,17 @@ export default function SpecialEditorPage() { }, [specialId]); const handleSaveStartTime = async (songId: number, startTime: number) => { - await fetch(`/api/specials/${specialId}/songs`, { + const res = await fetch(`/api/specials/${specialId}/songs`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ songId, startTime }), }); + + if (!res.ok) { + const errorText = await res.text().catch(() => res.statusText || 'Unknown error'); + console.error('Error updating special song (admin):', res.status, errorText); + throw new Error(`Failed to save start time: ${errorText}`); + } }; if (loading) {