Skip to content

Commit

Permalink
Fix unkeyed#2297:field should not allow only whitespace values
Browse files Browse the repository at this point in the history
  • Loading branch information
vinod-techstax committed Oct 11, 2024
1 parent b97201c commit 6e45634
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
},
});
async function onSubmit(values: z.infer<typeof formSchema>) {
if (values.defaultPrefix.trim() === '') {
return toast.error("Default prefix cannot be empty or contain only spaces.");
}
if (values.defaultPrefix.length > 8) {
return toast.error("Default prefix is too long, maximum length is 8 characters.");
}
Expand Down

0 comments on commit 6e45634

Please sign in to comment.