mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-10-28 06:59:10 +00:00
24 lines
567 B
TypeScript
24 lines
567 B
TypeScript
import { superValidate } from 'sveltekit-superforms/server';
|
|
import type { PageServerLoad } from '../$types';
|
|
import { appearanceFormSchema } from './appearance-form.svelte';
|
|
import { fail, type Actions } from '@sveltejs/kit';
|
|
|
|
export const load: PageServerLoad = async () => {
|
|
return {
|
|
form: await superValidate(appearanceFormSchema)
|
|
};
|
|
};
|
|
|
|
export const actions: Actions = {
|
|
default: async (event) => {
|
|
const form = await superValidate(event, appearanceFormSchema);
|
|
if (!form.valid) {
|
|
return fail(400, {
|
|
form
|
|
});
|
|
}
|
|
return {
|
|
form
|
|
};
|
|
}
|
|
};
|