UI Refactor and group support #13

Merged
glazk0 merged 17 commits from dev into main 2024-03-28 20:01:37 +01:00
Showing only changes of commit ec3a4b1ffe - Show all commits

View file

@ -1,9 +1,10 @@
import { fail, type Actions } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { z } from 'zod';
import { superValidate } from 'sveltekit-superforms/server';
import { API_URL } from '$env/static/private';
import { fail, type Actions } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { zod } from 'sveltekit-superforms/adapters';
import { superValidate } from 'sveltekit-superforms/server';
import { z } from 'zod';
const settingSchema = z.object({
firstname: z.string({
@ -20,7 +21,7 @@ const settingSchema = z.object({
export const load = (async ({ parent, locals: { user } }) => {
await parent();
const form = await superValidate(user, settingSchema);
const form = await superValidate(user, zod(settingSchema));
return {
form
@ -31,7 +32,7 @@ export const actions = {
default: async ({ request, cookies }) => {
const session = cookies.get('session');
const form = await superValidate(request, settingSchema);
const form = await superValidate(request, zod(settingSchema));
if (!form.valid) {
return fail(400, { form });