feat(api): upgrade zod to v4 and implement api docs and client generation
This commit is contained in:
parent
98776aacb2
commit
87dc6162f4
26 changed files with 4827 additions and 419 deletions
|
@ -1,13 +1,14 @@
|
|||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { z } from 'zod/v4';
|
||||
|
||||
export default function useZodForm<
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
Schema extends z.ZodType<any, any, any>,
|
||||
Values extends z.infer<Schema>,
|
||||
>(schema: Schema, defaultValues?: Values) {
|
||||
return useForm<Values>({
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return useForm<z.input<typeof schema>, any, z.output<typeof schema>>({
|
||||
resolver: zodResolver(schema),
|
||||
defaultValues,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue