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

Handle user trying to input an empty string in the front end #66

Open
helenzhou6 opened this issue Mar 29, 2018 · 0 comments
Open

Handle user trying to input an empty string in the front end #66

helenzhou6 opened this issue Mar 29, 2018 · 0 comments
Assignees
Labels
done issue fixed

Comments

@helenzhou6
Copy link

PaGiToNi/src/handler.js

Lines 79 to 85 in 7a5fea2

if (!searchedInput) {
console.log("Search call with empty or missing query");
res.writeHead(400, { "Content-Type": "application/json" });
res.end(JSON.stringify({
error: "Search call with empty or missing query"
}));
return;

I can see you're handling an empty input in the backend in handler.js - good job - could I suggest also handling it in the front-end too (perhaps on the front-end, if the user has tried to press enter or click on the submit button when the input is empty, it would display something and not send the request to the backend in the first place.

Very minor issue though!

@n1c0z n1c0z self-assigned this Mar 29, 2018
n1c0z pushed a commit that referenced this issue Mar 29, 2018
@n1c0z n1c0z added the done issue fixed label Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done issue fixed
Projects
None yet
Development

No branches or pull requests

2 participants