Skip to content

Commit 8c01a06

Browse files
committed
refactor(webapp): tighten admin rate-limit duration types
1 parent a325bd5 commit 8c01a06

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/webapp/app/components/admin/backOffice/RateLimitSection.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ import * as Property from "~/components/primitives/PropertyTable";
1010

1111
// Local shape mirrors the server-side discriminated union just enough for this
1212
// view. Decoupled from the .server module so the component stays client-safe.
13+
// Duration fields are always suffixed strings — the server's DurationSchema
14+
// rejects anything else, so non-string overrides fall back to the default.
1315
export type RateLimitConfig =
1416
| {
1517
type: "tokenBucket";
1618
refillRate: number;
17-
interval: string | number;
19+
interval: string;
1820
maxTokens: number;
1921
}
2022
| {
2123
type: "fixedWindow" | "slidingWindow";
22-
window: string | number;
24+
window: string;
2325
tokens: number;
2426
};
2527

0 commit comments

Comments
 (0)