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

Case sensitive inputs - quick but not ideal fix #34

Open
hannahgooding opened this issue Sep 11, 2020 · 0 comments
Open

Case sensitive inputs - quick but not ideal fix #34

hannahgooding opened this issue Sep 11, 2020 · 0 comments
Labels
code review enhancement New feature or request

Comments

@hannahgooding
Copy link

const search = (name) => {
//case sensitive - change in API if time permits
fetchHelper(`facts/name/${name}`, {}).then((facts) => {
drawFacts(facts);
});
};

You can control the case sensitivity of your user inputs like this:

add.fact.js L26-L27

const text_content = event.target.elements.new_fact.value.toLowerCase();
const about_who = event.target.elements.name.value.toLowerCase();

nav-bar.js L11

search(event.target.previousSibling.value.toLowerCase());

That way everything is converted to lowercase.

Of course this is a hacky quick fix for submissions through the front end form inputs only, I could still make a manual POST request to your API with something like Insomnia, so you're right that it would need to be fixed on the backend for full coverage.

@hannahgooding hannahgooding added code review enhancement New feature or request labels Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant