Skip to content

Commit

Permalink
[TOOL-3598] Dashboard: Add error message in create ecosystem form for…
Browse files Browse the repository at this point in the history
… image size
  • Loading branch information
MananTank committed Mar 4, 2025
1 parent 67354dc commit 42bef2b
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ const formSchema = z.object({
.refine((name) => /^[a-zA-Z0-9 ]*$/.test(name), {
message: "Name can only contain letters, numbers and spaces",
}),
logo: z.instanceof(File, {
message: "Logo is required",
}),
logo: z
.instanceof(File, {
message: "Logo is required",
})
.refine((file) => file.size <= 500 * 1024, {
message: "Logo size must be less than 500KB",
}),
permission: z.union([z.literal("PARTNER_WHITELIST"), z.literal("ANYONE")]),
});

Expand Down Expand Up @@ -119,7 +123,6 @@ export function CreateEcosystemForm(props: { teamSlug: string }) {
onUpload={(files) => {
if (files[0]) {
form.setValue("logo", files[0]);
form.clearErrors("logo");
}
}}
/>
Expand Down

0 comments on commit 42bef2b

Please sign in to comment.