Tighten admin specials handling and remove obsolete curate button

This commit is contained in:
Hördle Bot
2025-12-04 12:31:49 +01:00
parent b46e9e3882
commit 12cc81905e
2 changed files with 46 additions and 15 deletions

View File

@@ -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) {