refactor(actions): migrate viewall/search/unsubscribe to focused imports
This commit is contained in:
@@ -9,13 +9,16 @@ import { connect } from "react-redux";
|
|||||||
import {
|
import {
|
||||||
deleteAwaitingSubmissionsFromBlob,
|
deleteAwaitingSubmissionsFromBlob,
|
||||||
deleteMyRepresentationsFromBlob,
|
deleteMyRepresentationsFromBlob,
|
||||||
deleteWatchedCases,
|
|
||||||
getAwaitingSubmissionFromBlobProxy,
|
getAwaitingSubmissionFromBlobProxy,
|
||||||
getRepsFromBlobProxy,
|
getRepsFromBlobProxy
|
||||||
getWatchedCasesProxy,
|
} from "../../actions/services/documentService";
|
||||||
|
import {
|
||||||
|
createWatchedCases,
|
||||||
|
deleteWatchedCases,
|
||||||
getWatchedCases,
|
getWatchedCases,
|
||||||
createWatchedCases
|
getWatchedCasesProxy
|
||||||
} from "../../actions";
|
} from "../../actions/services/portalService";
|
||||||
|
import { consoleLogger } from "../../actions/core/logger";
|
||||||
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
|
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
|
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
createWatchedCases,
|
createWatchedCases,
|
||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
getWatchedCasesProxy
|
getWatchedCasesProxy
|
||||||
} from "../../actions";
|
} from "../../actions/services/portalService";
|
||||||
import RepsOnResults from "./repsonresults";
|
import RepsOnResults from "./repsonresults";
|
||||||
|
|
||||||
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ import Link from "next/link";
|
|||||||
import CookieBanner from "../../components/cookieBanner";
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
import Footer from "../../components/footer";
|
import Footer from "../../components/footer";
|
||||||
import Header from "../../components/header";
|
import Header from "../../components/header";
|
||||||
import {
|
import { hashAPIPath } from "../../actions/core/hash";
|
||||||
hashAPIPath,
|
import { getToken } from "../../actions/core/token";
|
||||||
getToken,
|
import { azureHeaders } from "../../actions/core/headers";
|
||||||
azureHeaders,
|
import { consoleLogger } from "../../actions/core/logger";
|
||||||
consoleLogger,
|
|
||||||
} from "../../actions";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const UnsubscribeCase = (props) => {
|
const UnsubscribeCase = (props) => {
|
||||||
@@ -97,8 +95,8 @@ const deleteWatchedCases = async (watchedCaseID) => {
|
|||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
"Authorization": "Bearer " + token.access_token,
|
"Authorization": "Bearer " + token.access_token,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json"
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return axios(config)
|
||||||
@@ -143,8 +141,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
? caseObj[
|
? caseObj[
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
: null,
|
: null
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ import Link from "next/link";
|
|||||||
import CookieBanner from "../../components/cookieBanner";
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
import Footer from "../../components/footer";
|
import Footer from "../../components/footer";
|
||||||
import Header from "../../components/header";
|
import Header from "../../components/header";
|
||||||
import {
|
import { hashAPIPath } from "../../actions/core/hash";
|
||||||
hashAPIPath,
|
import { getToken } from "../../actions/core/token";
|
||||||
getToken,
|
import { azureHeaders } from "../../actions/core/headers";
|
||||||
azureHeaders,
|
import { consoleLogger } from "../../actions/core/logger";
|
||||||
consoleLogger,
|
|
||||||
} from "../../actions";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const UnsubscribeCase = (props) => {
|
const UnsubscribeCase = (props) => {
|
||||||
@@ -118,8 +116,8 @@ const deleteWatchedCases = async (watchedCaseID) => {
|
|||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
"Authorization": "Bearer " + token.access_token,
|
"Authorization": "Bearer " + token.access_token,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json"
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return axios(config)
|
||||||
@@ -170,8 +168,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
//console.log(deleteCase);
|
//console.log(deleteCase);
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
caseRef: hasUnsubscribed ? searchResultsObj.value : null,
|
caseRef: hasUnsubscribed ? searchResultsObj.value : null
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user