diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 418f3183..5df1aaf2 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -115,9 +115,7 @@ let MakeRepresentation = (props) => { // ? true // : false; - const isNRW = accountDetails.emailaddress1.includes("@rdbtech.co.uk") - ? true - : false; + const isNRW = currentView.caseReference?.isNRW; const setRepFileName = (values) => { //console.log("---------------\n", values); diff --git a/pages/myportal/representation.js b/pages/myportal/representation.js index ccfd4c63..49d71986 100644 --- a/pages/myportal/representation.js +++ b/pages/myportal/representation.js @@ -340,8 +340,20 @@ export const getServerSideProps = wrapper.getServerSideProps( "viewKey": "myRepresentations", }) ); + + console.log( + accountDetails, + "===================== is nrw", + accountDetails.emailaddress1.includes(process.env.NRWDOMAIN), + "===================== " + ); + store.dispatch( setCurrentReference({ + "isNRW": + accountDetails.emailaddress1.includes( + process.env.NRWDOMAIN + ) || false, "ticketnumber": searchResultsObj.value[0].ticketnumber, "currentReference": searchResultsObj.value[0].title, "currentType": "myRepresentations",