Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: api validators (boolean and date) #7709

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Mar 7, 2024

  • no longer allow so many "date" options, like false, 0, etc.
  • standardize date validation (using isDateString)
  • standardize boolean validation (correctly converts 'false' and 'true' in query params, etc.

The e2e tests for the cli failed without fileCreatedAt.toISOString() after these changes, which now require valid date strings. I'm not sure what it was doing before but it is possible it was not working correctly.

Copy link

cloudflare-workers-and-pages bot commented Mar 7, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 03774d2
Status: ✅  Deploy successful!
Preview URL: https://a414e3f0.immich.pages.dev
Branch Preview URL: https://refactor-api-validators.immich.pages.dev

View logs

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Base automatically changed from refactor/person-api to main March 7, 2024 20:34
@jrasm91 jrasm91 merged commit a50f125 into main Mar 8, 2024
26 of 27 checks passed
@jrasm91 jrasm91 deleted the refactor/api-validators branch March 8, 2024 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants