Closed cmc333333 closed 8 years ago
@cmc333333 what do you think about skipping the request entirely when the query is empty, and showing a warning? That way we could avoid sending a request when we know the results will be empty.
That'd definitely be an improvement. I think it still makes sense to clean up the the search results page too (i.e. give it a 200 with a warning), for non-JS folks.
One more question--on the backend, prefer to make the change in -core, where the 400 is originally raised, or to catch it in -site, where we make a request to /api/search
?
I'd lean towards keeping the 400 api side (it feels more semantically accurate). What do you think?
Agree, an empty query is a user error in the api. Just wanted to check before potentially going down the wrong path!
This is then interpreted by the JS as an error. Probably want to 200 and display a warning, instead.
[18/Feb/2016 12:00:27] "GET /partial/search/555?q=&version=2015-25190 HTTP/1.1" 400 24