debuf fix on search results
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import https from "https";
|
||||
import CryptoJS from "crypto-js";
|
||||
import { getToken } from "../../../../actions";
|
||||
import { getToken, consoleLogger } from "../../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
||||
|
||||
+29
-31
@@ -128,41 +128,39 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
let searchResultsObj = await getBasicSearch(query.q);
|
||||
|
||||
if (_.has(searchResultsObj, "status") != false) {
|
||||
if (searchResultsObj.status == 400) {
|
||||
return {
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
//console.log("sssss", searchResultsObj);
|
||||
if (_.has(searchResultsObj, "status") == true) {
|
||||
return {
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
|
||||
return {
|
||||
props: { isLinkedCase: isLinked },
|
||||
};
|
||||
}
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
|
||||
return {
|
||||
props: { isLinkedCase: isLinked },
|
||||
};
|
||||
}
|
||||
// }
|
||||
// }
|
||||
);
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
|
||||
Reference in New Issue
Block a user