Skip to content

Commit

Permalink
Only accept natural numbers for population and year
Browse files Browse the repository at this point in the history
  • Loading branch information
lemilonkh committed Mar 19, 2024
1 parent d4b6283 commit eb0ad02
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/src/util/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ export type CreateUserRequest = z.infer<typeof createUserRequest>;

export const createPopulationRequest = z.object({
cityId: z.string().uuid(),
cityPopulation: z.number(),
regionPopulation: z.number(),
countryPopulation: z.number(),
cityPopulationYear: z.number(),
regionPopulationYear: z.number(),
countryPopulationYear: z.number(),
cityPopulation: z.number().gte(0),
regionPopulation: z.number().gte(0),
countryPopulation: z.number().gte(0),
cityPopulationYear: z.number().gte(0),
regionPopulationYear: z.number().gte(0),
countryPopulationYear: z.number().gte(0),
datasourceId: z.string().optional(),
});

Expand Down

0 comments on commit eb0ad02

Please sign in to comment.