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
-1
View File
@@ -16,7 +16,6 @@ import {
getSearchDocumentHistory,
getSearchDocumentHistoryPaged,
getSearchDocumentDetailsPaged,
getToken,
} from "../../actions";
import {
+7 -14
View File
@@ -6,7 +6,6 @@ import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
import { parseCookies } from "nookies";
import {
getToken,
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
@@ -37,26 +36,21 @@ const TopThree = (props) => {
let showTopThreeArr = showTopThree.value;
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;
@@ -72,7 +66,6 @@ const TopThree = (props) => {
} else {
detailsArr.push(
getPortalModuleDetailsProxy(
token,
getFormCollectionByID(
searchDetail.pinswg_appealcasetype
).LogicalCollectionName,
+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,
+1 -3
View File
@@ -27,10 +27,9 @@ export const getFormCollectionByID = (appealTypeID) => {
/*
* Get the details of a case from the appeal type
* @param String token
* @param object searchResultsObj
*/
export const getSearchDetails = (token, searchResultsObj) => {
export const getSearchDetails = (searchResultsObj) => {
//console.log(searchResultsObj);
let detailsArr = [];
@@ -45,7 +44,6 @@ export const getSearchDetails = (token, searchResultsObj) => {
//console.log(formMeta);
detailsArr.push(
getBasicSearchDetails(
token,
formMeta.LogicalCollectionName,
searchDetail.title,
formMeta.PrimaryIdAttribute,