Skip to content

Commit 1b7d29a

Browse files
committed
removed .or validation on zod
1 parent 9c9d091 commit 1b7d29a

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/BatchMetadata.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export function BatchMetadataModuleUI(
136136
function UploadMetadataNFTSection(props: {
137137
uploadMetadata: (values: UploadMetadataFormValues) => Promise<void>;
138138
}) {
139-
// TODO: add form validation here
140139
const form = useForm<UploadMetadataFormValues>({
141140
values: {
142141
supply: 1,

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/Claimable.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,12 @@ export function ClaimableModuleUI(
282282
}
283283

284284
const claimConditionFormSchema = z.object({
285-
tokenId: z.coerce
286-
.number()
287-
.min(0, { message: "Invalid tokenId" })
288-
.optional()
289-
.or(z.literal("")),
285+
tokenId: z.coerce.number().min(0, { message: "Invalid tokenId" }).optional(),
290286

291287
pricePerToken: z.coerce
292288
.number()
293289
.min(0, { message: "Invalid price per token" })
294-
.optional()
295-
.or(z.literal("")),
290+
.optional(),
296291
currencyAddress: z.string().optional(),
297292

298293
maxClaimableSupply: z
@@ -645,11 +640,7 @@ function PrimarySaleRecipientSection(props: {
645640
}
646641

647642
const mintFormSchema = z.object({
648-
tokenId: z.coerce
649-
.number()
650-
.min(0, { message: "Invalid tokenId" })
651-
.optional()
652-
.or(z.literal("")),
643+
tokenId: z.coerce.number().min(0, { message: "Invalid tokenId" }).optional(),
653644
quantity: z.coerce.number().min(0, { message: "Invalid quantity" }),
654645
recipient: addressSchema,
655646
});

0 commit comments

Comments
 (0)