mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-16 12:20:13 +01:00
fix: don't show validation error on upload modal if password or max views are empty
This commit is contained in:
parent
3ce18dc1dc
commit
fe09d0e25f
@ -92,8 +92,15 @@ const CreateUploadModalBody = ({
|
|||||||
.matches(new RegExp("^[a-zA-Z0-9_-]*$"), {
|
.matches(new RegExp("^[a-zA-Z0-9_-]*$"), {
|
||||||
message: t("upload.modal.link.error.invalid"),
|
message: t("upload.modal.link.error.invalid"),
|
||||||
}),
|
}),
|
||||||
password: yup.string().min(3).max(30),
|
password: yup
|
||||||
maxViews: yup.number().min(1),
|
.string()
|
||||||
|
.transform((value) => value || undefined)
|
||||||
|
.min(3)
|
||||||
|
.max(30),
|
||||||
|
maxViews: yup
|
||||||
|
.number()
|
||||||
|
.transform((value) => value || undefined)
|
||||||
|
.min(1),
|
||||||
});
|
});
|
||||||
|
|
||||||
const form = useForm({
|
const form = useForm({
|
||||||
@ -151,8 +158,8 @@ const CreateUploadModalBody = ({
|
|||||||
recipients: values.recipients,
|
recipients: values.recipients,
|
||||||
description: values.description,
|
description: values.description,
|
||||||
security: {
|
security: {
|
||||||
password: values.password,
|
password: values.password || undefined,
|
||||||
maxViews: values.maxViews,
|
maxViews: values.maxViews || undefined,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
files,
|
files,
|
||||||
|
Loading…
Reference in New Issue
Block a user