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
+11 -22
View File
@@ -39,7 +39,6 @@ import {
import {
createWatchedCases,
getToken,
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
@@ -78,8 +77,6 @@ const SearchResults = (props) => {
const cookies = parseCookies();
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
let token = getToken();
let updateBody = {
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
@@ -89,13 +86,11 @@ const SearchResults = (props) => {
createWatchedCases(updateBody)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(token, cookies.pinsUser).then((data) => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(token, data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
);
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
@@ -110,26 +105,21 @@ const SearchResults = (props) => {
};
const deleteItem = (caseID, topThreeType) => {
let token = getToken();
let cookies = parseCookies();
topThreeType == "watchedCases" &&
deleteWatchedCases(caseID)
.then((data) => data)
.then(() => {
getWatchedCasesProxy(token, cookies.pinsUser).then(
(data) => {
setWatchedCases(data),
getDetails(token, data, "myWatchedCases").then(
(data) => {
setWatchedCasesDetails(data);
}
);
}
);
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases").then((data) => {
setWatchedCasesDetails(data);
});
});
});
};
const getDetails = (token, resultsObj, detailsType) => {
const getDetails = (resultsObj, detailsType) => {
//console.log(resultsObj);
let detailsArr = [];
resultsObj = resultsObj.value;
@@ -145,7 +135,6 @@ const SearchResults = (props) => {
} else {
detailsArr.push(
getPortalModuleDetailsProxy(
token,
getFormCollectionByID(
searchDetail.pinswg_appealcasetype
).LogicalCollectionName,