-
Notifications
You must be signed in to change notification settings - Fork 495
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
Add scope to routes, to unify url with frontend #570
Conversation
config/routes.rb
Outdated
resource :account, controller: :account, only: %i[show create update] | ||
resources :account_confirmations, only: %i[show] | ||
resources :passwords, controller: :passwords, only: %i[create update] | ||
namespace :api, defaults: { format: 'json' } do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API in Spree is not locale-scoped, so these routes should go outside of the scope :locale
thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For them, locale is always passed as a query param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that makes sense. I've fixed it.
@wjwitek , I think I found a place where the locale is still not persisting, can you check it out? Steps:
Hopefully I've correctly replicated your setup :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some feedback on a couple tests, I'll take a look at the rest today as well 😎
Great so far on covering the various test cases, this'll really help us make sure we're not breaking locale in the future. I feel like this'll be good to go once the tests are ironed out 💪 |
Co-authored-by: nciemniak <nciemniak@gmail.com>
Co-authored-by: nciemniak <nciemniak@gmail.com>
Co-authored-by: nciemniak <nciemniak@gmail.com>
Co-authored-by: nciemniak <nciemniak@gmail.com>
Co-authored-by: nciemniak <nciemniak@gmail.com>
Change locale from being in url as param, to being part of url, using scope in routes.
It will break locale for legacy_frontend however (they'll be lost while clicking log out etc.), without this fix spree/spree_rails_frontend#31.