Almost done

This commit is contained in:
2026-03-05 17:35:27 +01:00 Unverified
parent 278471e53b
commit e44fceaf32
30 changed files with 1077 additions and 572 deletions
+30
View File
@@ -0,0 +1,30 @@
// app/admin/actions.ts
'use server';
import { getConfig, updateConfig } from '../lib/config';
import { revalidatePath } from 'next/cache';
export async function saveConfigAction(prevState: any, formData: FormData) {
const config = await getConfig();
const newConfig = {
...config,
showBeachPromo: formData.get('showBeachPromo') === 'on',
beachPage: {
...config.beachPage,
matchStart: formData.get('matchStart') as string,
festivalLink: formData.get('festivalLink') as string,
closeReason: formData.get('closeReason') as string,
otherInfo: formData.get('otherInfo') as string,
prizesText: formData.get('prizesText') as string,
isClosedOverride: formData.get('isClosedOverride') === 'on',
}
};
await updateConfig(newConfig);
revalidatePath('/');
revalidatePath('/beach');
return { success: true };
}