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

PL regional partner search: validate ZIP code before searching #25069

Merged
merged 3 commits into from
Sep 27, 2018

Conversation

breville
Copy link
Member

Invalid ZIP codes will just show the generic error message about no partner found.

Invalid ZIP codes will just show the generic error message about no partner found.
@@ -18,7 +18,7 @@ def capacity

# GET /api/v1/regional_partners/find
def find
zip_code = params[:zip_code]
zip_code = params[:zip_code] if RegexpUtils.us_zip_code?(params[:zip_code])
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be initialized to nil otherwise, in order to be used on line 25?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wondered the same thing, and it worked okay, but I agree that it seems proper to initialise to nil, so I'll do that.

@breville breville merged commit 1a7237b into staging Sep 27, 2018
@breville breville deleted the regional-partner-search-validate-zip branch September 27, 2018 20:28
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.

None yet

2 participants