Skip to content

Commit

Permalink
Merge pull request #558 from lexicongovernance/develop
Browse files Browse the repository at this point in the history
fix empty string not throwing error (#557)
  • Loading branch information
diegoalzate authored May 23, 2024
2 parents de24650 + 660af0e commit bd26363
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/berlin/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,14 @@ function NumberInput(props: {
return true;
}

if (value.trim() === '') {
return 'Value is required';
}

const v = z.coerce
.number()
.int('Value has to be an integer')
.min(0, 'Value must be positive')
.nonnegative('Value must be positive')
.safeParse(value);

if (v.success) {
Expand Down

0 comments on commit bd26363

Please sign in to comment.