-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix State Field Case Sensitivity for Ambassador Sign-Up #121
Comments
I wonder if this change to HelloVoter would fix this issue: diff --git a/server/app/services/ambassadors.js b/server/app/services/ambassadors.js
index 36b63662..f77aec95 100644
--- a/server/app/services/ambassadors.js
+++ b/server/app/services/ambassadors.js
@@ -59,8 +59,8 @@ async function signup(json) {
throw new ValidationError("Our system doesn’t recognize that phone number. Please try again.");
}
- let allowed_states = ov_config.allowed_states.split(',');
- if (allowed_states.indexOf(json.address.state) === -1) {
+ let allowed_states = ov_config.allowed_states.toUpperCase().split(',');
+ if (allowed_states.indexOf(json.address.state.toUpperCase()) === -1) {
throw new ValidationError("Sorry, but state employment laws don't allow us to pay Voting Ambassadors in your state.")
} |
joshmaker
added a commit
to joshmaker/HelloVoter
that referenced
this issue
Sep 26, 2020
indexOf() is case sensitive, so this code converts both the list of allowed states and the state in the JSON request to uppercase before doing the search to ensure a case insensitive match. It then saves the state into Neo4J as uppercase for consistency. See: colab-coop/hello-voter#121 colab-coop#46
I think this ticket should be resolved now that colab-coop/HelloVoter#48 has been merged. Basically, I convert everything to uppercase on the backend that way the API can receive lower, upper, or mixed case state abbreviations and it won't matter. |
That's so awesome @joshmaker - thank you! ill test it out on stage2 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
As an Ambassador going through the sign-up workflow, I do not want to be blocked by entering my state in lowercase format so that I do not experience any friction in the sign-up process.
Requirements
Current page/error message for reference:
![Screen Shot 2020-09-25 at 6 49 45 PM](https://user-images.githubusercontent.com/8608070/94345311-d84afa80-ffd9-11ea-9bb4-2e0ca3eede0a.png)
The text was updated successfully, but these errors were encountered: