Tighten admin specials handling and remove obsolete curate button
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user