Skip to content

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

@helenzhou6

Description

@helenzhou6

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!

Metadata

Metadata

Assignees

Labels

doneissue fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions