mirror of
https://git.mirrors.martin98.com/https://github.com/bytedance/deer-flow
synced 2025-08-19 18:29:06 +08:00
fix: general form validation
This commit is contained in:
parent
5ffac750a1
commit
397eab0596
@ -45,6 +45,7 @@ export const GeneralTab: Tab = ({
|
||||
const form = useForm<z.infer<typeof generalFormSchema>>({
|
||||
resolver: zodResolver(generalFormSchema, undefined, undefined),
|
||||
values: generalSettings,
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
const currentSettings = form.watch();
|
||||
@ -102,10 +103,10 @@ export const GeneralTab: Tab = ({
|
||||
<Input
|
||||
className="w-60"
|
||||
type="number"
|
||||
{...field}
|
||||
defaultValue={1}
|
||||
min={1}
|
||||
onChange={(event) =>
|
||||
field.onChange(parseInt(event.target.value))
|
||||
field.onChange(parseInt(event.target.value || "0"))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
@ -127,10 +128,10 @@ export const GeneralTab: Tab = ({
|
||||
<Input
|
||||
className="w-60"
|
||||
type="number"
|
||||
{...field}
|
||||
defaultValue={1}
|
||||
min={1}
|
||||
onChange={(event) =>
|
||||
field.onChange(parseInt(event.target.value))
|
||||
field.onChange(parseInt(event.target.value || "0"))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
|
Loading…
x
Reference in New Issue
Block a user