refactor(validation): restucture api input and output validation
All checks were successful
container-scan / Container Scan (pull_request) Successful in 5m17s
docker-build / docker (pull_request) Successful in 6m1s

This commit is contained in:
Dominik 2025-06-18 21:36:30 +02:00
parent 485a95f99a
commit eef17c5360
Signed by: dominik
GPG key ID: 06A4003FC5049644
34 changed files with 1891 additions and 1802 deletions

View file

@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation';
import LabeledInput from '@/components/custom-ui/labeled-input';
import { Button } from '@/components/ui/button';
import useZodForm from '@/lib/hooks/useZodForm';
import { loginClientSchema, registerClientSchema } from '@/lib/validation/user';
import { loginSchema, registerSchema } from '@/lib/auth/validation';
import { loginAction } from '@/lib/auth/login';
import { registerAction } from '@/lib/auth/register';
@ -18,7 +18,7 @@ function LoginFormElement({
formRef?: React.RefObject<HTMLFormElement | null>;
}) {
const { handleSubmit, formState, register, setError } =
useZodForm(loginClientSchema);
useZodForm(loginSchema);
const router = useRouter();
const onSubmit = handleSubmit(async (data) => {
@ -95,7 +95,7 @@ function RegisterFormElement({
formRef?: React.RefObject<HTMLFormElement | null>;
}) {
const { handleSubmit, formState, register, setError } =
useZodForm(registerClientSchema);
useZodForm(registerSchema);
const onSubmit = handleSubmit(async (data) => {
try {