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

OTT-180 Use router to parse routes #1832

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jebw
Copy link
Contributor

@jebw jebw commented Apr 22, 2024

Incorrectly formatted requests now return a 404

Jira link

OTT-180

What?

I have added/removed/altered:

  • Moved the logic for parsing the exchange rates params out into the router

Why?

I am doing this because:

  • Invalid :id's were being passed to the controller but then could not be parsed because they did not follow the expected format
  • This lets the router deal with parsing path params

Deployment risks (optional)

  • Notable, this is a simple change but it affects a crucial service so needs to be thoroughly checked prior to deployment

Incorrectly formatted requests now return a 404
@jebw jebw force-pushed the OTT-180-exchange-rates-routing-rules branch from badb490 to 4cc9f09 Compare April 22, 2024 08:23
@jebw jebw marked this pull request as draft April 22, 2024 08:25
get 'files/(:type)_:year-:month', to: 'files#show',
as: :file,
constraints: {
type: ExchangeRateFile.type_check_regexp,
Copy link
Member

Choose a reason for hiding this comment

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

Sexy

Copy link
Member

@willfish willfish left a comment

Choose a reason for hiding this comment

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

I love it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants