Skip to content

Commit eb514ee

Browse files
authored
fix: cap dashboard min ratelimtit interval (#4496)
1 parent 346ee3a commit eb514ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_components/create-key/create-key.schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const refillSchema = z.discriminatedUnion("interval", [
116116
refillDay: z.undefined().optional(),
117117
}),
118118
]);
119+
119120
export const ratelimitItemSchema = z.object({
120121
id: z.string().nullish(), // Will be used only for updating case
121122
name: z
@@ -128,7 +129,7 @@ export const ratelimitItemSchema = z.object({
128129
message: issue.code === "invalid_type" ? "Duration must be greater than 0" : defaultError,
129130
}),
130131
})
131-
.positive({ message: "Refill interval must be greater than 0" }),
132+
.min(1000, { message: "Refill interval must be at least 1 second (1000ms)" }),
132133
limit: z.coerce
133134
.number({
134135
errorMap: (issue, { defaultError }) => ({

0 commit comments

Comments
 (0)