remove references to token

This commit is contained in:
2022-01-13 13:54:06 +00:00
parent af13552717
commit bef5e8abcc
52 changed files with 393 additions and 381 deletions
+2 -5
View File
@@ -77,12 +77,9 @@ const Home = (props) => {
export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
let token = await getToken();
token = token.access_token;
const [appealTypeData, lpaData] = await Promise.all([
await getAppealsTypes(token),
await getLPA(token),
await getAppealsTypes(),
await getLPA(),
]);
store.dispatch(setAppealType(appealTypeData));
+1 -4
View File
@@ -62,10 +62,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
console.log("query-", query);
//console.log("search array:", Object.entries(query));
let token = await getToken();
token = token.access_token;
const searchResultsObj = await getAdvancedSearch(token, query);
const searchResultsObj = await getAdvancedSearch(query);
const searchDetailsObj = await getSearchDetails(
token,
searchResultsObj
+9 -12
View File
@@ -167,9 +167,6 @@ export const getServerSideProps = wrapper.getServerSideProps(
// console.log("the cookoies", cookies);
let token = await getToken();
token = token.access_token;
let loggedInUser = cookies.pinsUser;
let providerConfig = await getProviderConfig();
@@ -191,11 +188,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
watchedCases,
awaitingSubmission,
] = await Promise.all([
await getPersonalAccount(token, loggedInUser),
await getMyCases(token, loggedInUser),
await getMyRepresentations(token, loggedInUser),
await getWatchedCases(token, loggedInUser),
await getAwaitingSubmission(token),
await getPersonalAccount(loggedInUser),
await getMyCases(loggedInUser),
await getMyRepresentations(loggedInUser),
await getWatchedCases(loggedInUser),
await getAwaitingSubmission(),
]);
//const cookiesMaker = nookies.get(ctx)
@@ -219,9 +216,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
watchedCasesDetails,
// awaitingSubmissionDetails,
] = await Promise.all([
await getDetails(token, myCases, "myCases"),
await getDetails(token, myRepresentations, "myRepresentations"),
await getDetails(token, watchedCases, "myWatchedCases"),
await getDetails(myCases, "myCases"),
await getDetails(myRepresentations, "myRepresentations"),
await getDetails(watchedCases, "myWatchedCases"),
//await getDetails(awaitingSubmission),
]);
@@ -243,7 +240,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
}
);
const getDetails = (token, resultsObj, detailsType) => {
const getDetails = (resultsObj, detailsType) => {
console.log(detailsType);
let detailsArr = [];
resultsObj = resultsObj.value;
+5 -8
View File
@@ -82,14 +82,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
const { cookies } = req;
let token = await getToken();
token = token.access_token;
let loggedInUser = cookies.pinsUser;
let [searchResultsObj, watchedCases] = await Promise.all([
await getBasicSearch(token, query.q),
await getWatchedCases(token, loggedInUser),
await getBasicSearch(query.q),
await getWatchedCases(loggedInUser),
]);
searchResultsObj =
@@ -104,8 +101,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
//console.log("sssss", searchResultsObj);
const [searchDetailsObj, watchedCasesDetails] = await Promise.all([
await getSearchDetails(token, searchResultsObj),
await getDetails(token, watchedCases, "myWatchedCases"),
await getSearchDetails(searchResultsObj),
await getDetails(watchedCases, "myWatchedCases"),
]);
store.dispatch(setSearchResults(searchResultsObj));
@@ -116,7 +113,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
}
);
const getDetails = (token, resultsObj, detailsType) => {
const getDetails = (resultsObj, detailsType) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;