fix
Some checks failed
Docker image / build-and-push-image (push) Has been cancelled

This commit is contained in:
Your Name 2024-11-22 14:09:52 -07:00
parent 4503027266
commit 44dc7bb615

View File

@ -74,8 +74,14 @@ const MetadataForm = ({ defaultValues, onSubmit }: MetadataFormProps) => {
autoComplete="off" autoComplete="off"
isDisabled={isSubmitting} isDisabled={isSubmitting}
{...register("displayName", { {...register("displayName", {
minLength: 2, minLength: {
maxLength: 64, value: 2,
message: "Must be at least 2 characters long",
},
maxLength: {
value: 64,
message: "Cannot exceed 64 characters",
}
})} })}
/> />
<FormErrorMessage>{errors.displayName?.message}</FormErrorMessage> <FormErrorMessage>{errors.displayName?.message}</FormErrorMessage>
@ -86,10 +92,19 @@ const MetadataForm = ({ defaultValues, onSubmit }: MetadataFormProps) => {
autoComplete="off" autoComplete="off"
isDisabled={isSubmitting} isDisabled={isSubmitting}
{...register("username", { {...register("username", {
minLength: 2, minLength: {
maxLength: 64, value: 2,
required: true, message: "Must be at least 2 characters long",
pattern: /^[a-zA-Z0-9_-]{4,64}$/, },
maxLength: {
value: 64,
message: "Cannot exceed 64 characters",
},
required: "Username is required",
pattern: {
value: /^[a-zA-Z0-9_-]{2,64}$/,
message: "Only letters, numbers, underscores, and hyphens, and must be 2-64 characters",
},
})} })}
/> />
<FormErrorMessage>{errors.username?.message}</FormErrorMessage> <FormErrorMessage>{errors.username?.message}</FormErrorMessage>