watched case and stop wathcing case added
This commit is contained in:
+16
-30
@@ -154,11 +154,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const token = await getSASToken();
|
||||
|
||||
console.log("does it have ", cookies.pinsUser);
|
||||
let loggedInUser = cookies.pinsUser;
|
||||
|
||||
console.log("qweqe ", loggedInUser);
|
||||
|
||||
const [
|
||||
accountDetails,
|
||||
myCases,
|
||||
@@ -174,36 +171,15 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
]);
|
||||
|
||||
//const cookiesMaker = nookies.get(ctx)
|
||||
|
||||
let now = new Date();
|
||||
let expDate = new Date(now);
|
||||
expDate.setDate(now.getDate() + 1);
|
||||
|
||||
console.log(
|
||||
"Check: ",
|
||||
cookies,
|
||||
cookies.pinsUser,
|
||||
loggedInUser,
|
||||
nookies.get("pinsUser")
|
||||
);
|
||||
|
||||
// nookies.set(ctx, "pinsUser", loggedInUser, {
|
||||
// expires: expDate,
|
||||
// httpOnly: false,
|
||||
// path: "/",
|
||||
// });
|
||||
|
||||
console.log(" from cookie ", cookies);
|
||||
|
||||
const [
|
||||
myCasesDetails,
|
||||
myRepresentationsDetails,
|
||||
watchedCasesDetails,
|
||||
// awaitingSubmissionDetails,
|
||||
] = await Promise.all([
|
||||
await getDetails(token, myCases),
|
||||
await getDetails(token, myRepresentations),
|
||||
await getDetails(token, watchedCases),
|
||||
await getDetails(token, myCases, "myCases"),
|
||||
await getDetails(token, myRepresentations, "myRepresentations"),
|
||||
await getDetails(token, watchedCases, "myWatchedCases"),
|
||||
// await getDetails(awaitingSubmission),
|
||||
]);
|
||||
|
||||
@@ -222,20 +198,30 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
}
|
||||
);
|
||||
|
||||
const getDetails = (token, resultsObj) => {
|
||||
const getDetails = (token, resultsObj, detailsType) => {
|
||||
//console.log(resultsObj);
|
||||
let detailsArr = [];
|
||||
resultsObj = resultsObj.value;
|
||||
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
console.log(searchDetail.ticketnumber);
|
||||
console.log(
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
);
|
||||
} else {
|
||||
detailsArr.push(
|
||||
getPortalModuleDetails(
|
||||
token,
|
||||
getFormCollectionByID(searchDetail.pinswg_appealcasetype)
|
||||
.LogicalCollectionName,
|
||||
searchDetail.ticketnumber
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user