Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AxeemHaider committed Mar 19, 2021
1 parent e8b8ee0 commit d2b5044
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/core/Layout/Main/Components/SearchAppBar/SearchAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ const SearchAppBar = () => {
const response = await SearchAPI(value);
AppActions.setLoading(false);

if (!response.error && !response.data.error) {
console.log(response);
AppActions.loadSearchData(response);
console.log(response);

if (!response.error) {
if (response.data && !response.data.error) {
AppActions.loadSearchData(response);
}
} else {
console.log(response);
if (response.error) {
enqueueSnackbar(response.error.message, { variant: "error" });
} else if (response.data.error) {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Home = () => {
return <Books collection={search.nlp.collection} bookList={search.data} />;
}

return <h1>Default Home</h1>;
return <h1>Unable to understand query, type something else</h1>;
};

export default Home;

0 comments on commit d2b5044

Please sign in to comment.