Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(shared): parse an id param's digits with Number before the integer check

Maurice26b220470acd
diff --git a/shared/src/common/primitives.schema.ts b/shared/src/common/primitives.schema.ts
index b564c31ba..313488683 100644
--- a/shared/src/common/primitives.schema.ts
+++ b/shared/src/common/primitives.schema.ts
@@ -18,7 +18,8 @@ export type Id = z.infer<typeof idSchema>;
*/
export const idParamSchema = z
.union([z.number().int(), z.string().regex(/^\d+$/)])
- .pipe(z.coerce.number().int().positive());
+ .transform(Number)
+ .pipe(z.number().int().positive());
/**
* A row id written as text: decimal digits naming a safe integer, kept as the