Skip to content

Commit 556eedf

Browse files
committed
Adds int validation
1 parent c4f83c7 commit 556eedf

File tree

1 file changed

+5
-2
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches

1 file changed

+5
-2
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,14 @@ export const schema = CreateBranchOptions.and(
128128
const PurchaseSchema = z.discriminatedUnion("action", [
129129
z.object({
130130
action: z.literal("purchase"),
131-
amount: z.coerce.number().min(0, "Amount must be 0 or more"),
131+
amount: z.coerce.number().int("Must be a whole number").min(0, "Amount must be 0 or more"),
132132
}),
133133
z.object({
134134
action: z.literal("quota-increase"),
135-
amount: z.coerce.number().min(1, "Amount must be greater than 0"),
135+
amount: z.coerce
136+
.number()
137+
.int("Must be a whole number")
138+
.min(1, "Amount must be greater than 0"),
136139
}),
137140
]);
138141

0 commit comments

Comments
 (0)