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: use combined route validators and handlers #3428

Merged
merged 10 commits into from
Feb 14, 2022

Conversation

tshuli
Copy link
Contributor

@tshuli tshuli commented Feb 14, 2022

This PR is a copy of #2819. Reopening to trigger CI/CD

Problem

Prevent developers from forgetting the use of validators when using a controller handler.

Closes #1642

Solution

As suggested in the issue, put the original handler with a validation middleware in an array, and expose the final array for usage rather than the original handler

Breaking Changes

  • Yes - this PR contains breaking changes
    • Details ...
  • No - this PR is backwards compatible

Improvements:

  • Details ...

Tests

Ran a regression test using npm run test-backend, and ran happy-path testing locally with the changed routes

@tshuli tshuli requested a review from karrui February 14, 2022 07:09
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @tehtea again! Sorry we had to rebranch in order to get the CI/CD working 👀

@tshuli tshuli merged commit e4e9594 into develop Feb 14, 2022
@tshuli tshuli deleted the refactor/tehtea-combine-validators-and-handlers branch February 14, 2022 07:20
@karrui karrui mentioned this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combine validators with handler functions and export them atomically
3 participants