Updated so that the rules and class text can be updated through the admin page

This commit is contained in:
2026-04-19 13:28:13 +02:00 Verified
parent 16f5c3f22b
commit 0d4d447569
11 changed files with 103 additions and 39 deletions
+4 -1
View File
@@ -5,7 +5,7 @@
import { getConfig, updateConfig } from '../lib/config';
import { revalidatePath } from 'next/cache';
export async function saveConfigAction(prevState: any, formData: FormData) {
export async function saveConfigAction(prevState: { success?: boolean } | null | unknown, formData: FormData) {
const config = await getConfig();
let parsedClasses = [];
@@ -26,6 +26,9 @@ export async function saveConfigAction(prevState: any, formData: FormData) {
closeReason: formData.get('closeReason') as string,
otherInfo: formData.get('otherInfo') as string,
prizesText: formData.get('prizesText') as string,
rulesText: formData.get('rulesText') as string,
classesIntroText: formData.get('classesIntroText') as string,
classesOutroText: formData.get('classesOutroText') as string,
isClosedOverride: formData.get('isClosedOverride') === 'on',
classes: parsedClasses,
}