Fix validation issues of the language profile editor

This commit is contained in:
LASER-Yi 2022-09-22 19:46:03 +08:00
parent a338de147e
commit 4826cb8487

View file

@ -49,7 +49,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
const form = useForm({ const form = useForm({
initialValues: profile, initialValues: profile,
validate: { validate: {
name: (value) => value.length > 0, name: (value) => (value.length > 0 ? null : "Must have a name"),
items: (value) => items: (value) =>
value.length > 0 ? null : "Must contain at lease 1 language", value.length > 0 ? null : "Must contain at lease 1 language",
}, },