fix: changed search fail state to update regardless if query made

Signed-off-by: Raul Kele <raulkeleblk@gmail.com>
This commit is contained in:
Raul Kele 2022-10-18 11:00:19 +03:00
parent 68b713129d
commit 72f8c7cd61

View File

@ -104,9 +104,9 @@ function SearchSuggestion() {
const handleSeachChange = (event) => {
const value = event.inputValue;
setSearchQuery(value);
setIsFailedSearch(false);
if (value !== '' && value.length > 1) {
setIsLoading(true);
setIsFailedSearch(false);
api
.get(
`${host()}${endpoints.globalSearch({ searchQuery: value, pageNumber: 1, pageSize: 9 })}`,