Skip to content

Commit 92cac6f

Browse files
konardclaude
andcommitted
fix(api): remove type cast in account-pool route, use Schema.Literal
Replace `as "claude" | "codex" | "gemini"` cast with Schema.Literal validation in the route params schema. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 84dd3fb commit 92cac6f

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/api/src/http.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,13 @@ export const makeRouter = () => {
436436
),
437437
HttpRouter.get(
438438
"/account-pool/:provider",
439-
HttpRouter.schemaParams(Schema.Struct({ provider: Schema.String })).pipe(
440-
Effect.flatMap(({ provider }) => {
441-
const p = provider as "claude" | "codex" | "gemini"
442-
return jsonResponse({
443-
accounts: listPoolAccounts(p),
444-
summary: getPoolSummary(p)
439+
HttpRouter.schemaParams(Schema.Struct({ provider: Schema.Literal("claude", "codex", "gemini") })).pipe(
440+
Effect.flatMap(({ provider }) =>
441+
jsonResponse({
442+
accounts: listPoolAccounts(provider),
443+
summary: getPoolSummary(provider)
445444
}, 200)
446-
}),
445+
),
447446
Effect.catchAll(errorResponse)
448447
)
449448
),

0 commit comments

Comments
 (0)