Skip to content

Commit 5f5c8d7

Browse files
committed
Allow submitting zero concurrency so you can downgrade back to nothing
1 parent 8d2dbbc commit 5f5c8d7

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
115115

116116
const FormSchema = z.discriminatedUnion("action", [
117117
z.object({
118-
action: z.enum(["purchase", "quota-increase"]),
118+
action: z.enum(["purchase"]),
119+
amount: z.coerce.number().min(0, "Amount must be 0 or more"),
120+
}),
121+
z.object({
122+
action: z.enum(["quota-increase"]),
119123
amount: z.coerce.number().min(1, "Amount must be greater than 0"),
120124
}),
121125
z.object({

0 commit comments

Comments
 (0)