debuf fix on search results
This commit is contained in:
+6
-2
@@ -31,8 +31,11 @@ export const consoleLogger = (err) => {
|
|||||||
err.response.status +
|
err.response.status +
|
||||||
" : " +
|
" : " +
|
||||||
err.response.statusText +
|
err.response.statusText +
|
||||||
|
"\nRequest URL: " +
|
||||||
|
err.response.config.url +
|
||||||
|
"\nRequest Time: " +
|
||||||
|
err.response.headers.date +
|
||||||
"\n///////";
|
"\n///////";
|
||||||
|
|
||||||
return errStr;
|
return errStr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,7 +53,8 @@ export const getToken = () => {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
//console.log("error :", error.response);
|
//console.log("error :", error.response);
|
||||||
// return error;
|
consoleLogger(error);
|
||||||
|
return error;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
import https from "https";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken } from "../../../../actions";
|
import { getToken, consoleLogger } from "../../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
||||||
|
|||||||
+29
-31
@@ -128,41 +128,39 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
|
|
||||||
let searchResultsObj = await getBasicSearch(query.q);
|
let searchResultsObj = await getBasicSearch(query.q);
|
||||||
|
|
||||||
if (_.has(searchResultsObj, "status") != false) {
|
searchResultsObj =
|
||||||
if (searchResultsObj.status == 400) {
|
searchResultsObj.status == 502
|
||||||
return {
|
? {
|
||||||
redirect: {
|
value: [],
|
||||||
//destination: "/dns-not-found",
|
errorCode: searchResultsObj.status,
|
||||||
destination: "/error",
|
errorMsg: searchResultsObj.statusText,
|
||||||
permanent: false,
|
}
|
||||||
},
|
: searchResultsObj;
|
||||||
};
|
|
||||||
} else {
|
|
||||||
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(
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
searchResultsObj
|
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
);
|
store.dispatch(setSearch(query.q));
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
|
||||||
store.dispatch(setSearch(query.q));
|
|
||||||
|
|
||||||
return {
|
|
||||||
props: { isLinkedCase: isLinked },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: { isLinkedCase: isLinked },
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
);
|
);
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user