refactor: upgrade to Zod v4 (#623)

This commit is contained in:
Elias Schneider
2025-06-08 15:44:59 +02:00
committed by GitHub
parent 9a4aab465a
commit 388a874922
18 changed files with 270 additions and 51 deletions

View File

@@ -9,7 +9,7 @@
import { preventDefault } from '$lib/utils/event-util';
import { createForm } from '$lib/utils/form-util';
import { toast } from 'svelte-sonner';
import { z } from 'zod';
import { z } from 'zod/v4';
let {
callback,
@@ -35,7 +35,7 @@
.min(2)
.max(30)
.regex(/^[a-z0-9_@.-]+$/, m.username_can_only_contain()),
email: z.string().email(),
email: z.email(),
isAdmin: z.boolean()
});
type FormSchema = typeof formSchema;

View File

@@ -1,8 +1,9 @@
<script lang="ts">
import * as Select from '$lib/components/ui/select';
import { getLocale, setLocale, type Locale } from '$lib/paraglide/runtime';
import { getLocale, type Locale } from '$lib/paraglide/runtime';
import UserService from '$lib/services/user-service';
import userStore from '$lib/stores/user-store';
import { setLocale } from '$lib/utils/locale.util';
const userService = new UserService();
const currentLocale = getLocale();