EIA requried fields updating

This commit is contained in:
2025-03-25 10:47:22 +00:00
parent a6cdec43e1
commit 1c65d49110
24 changed files with 185 additions and 102 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export default async function ApiProxy(req, res) {
var token = await getToken();
var queryUrl =
"pinswg_sipsprojecttypes?$select=pinswg_name,pinswg_sector,pinswg_sipsprojecttypeid&$orderby=pinswg_name asc&$count=true";
"pinswg_sipsprojecttypes?$select=pinswg_name,pinswg_sipsprojecttypeid&$orderby=pinswg_name asc&$count=true";
//console.log(queryUrl);
+6 -5
View File
@@ -45,6 +45,7 @@ export default async function ApiProxy(req, res) {
loggedInUserId +
"&$select=modifiedon,pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode,pinswg_representationsubmitted,pinswg_representationtype&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
console.log(queryUrl);
return axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
@@ -52,7 +53,7 @@ export default async function ApiProxy(req, res) {
)
.then(({ data }) => {
data.value.forEach(function (element) {
element.ticketnumber = element.pinswg_WatchedCase.ticketnumber;
element.ticketnumber = element.pinswg_WatchedCase?.ticketnumber;
element.pinswg_title =
element[
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
@@ -61,19 +62,19 @@ export default async function ApiProxy(req, res) {
element[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
] =
element.pinswg_WatchedCase[
element.pinswg_WatchedCase?.[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
];
element._pinswg_associatedlpa_value =
element.pinswg_WatchedCase._pinswg_associatedlpa_value;
element.pinswg_WatchedCase?._pinswg_associatedlpa_value;
element[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
] =
element.pinswg_WatchedCase[
element.pinswg_WatchedCase?.[
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
];
element._ownerid_value =
element.pinswg_WatchedCase._ownerid_value;
element.pinswg_WatchedCase?._ownerid_value;
delete element.pinswg_WatchedCase;
});
+9 -6
View File
@@ -9,6 +9,7 @@ import {
getIP,
getLPA,
getPersonalAccount,
getProjectTypes,
} from "../../actions";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
@@ -22,7 +23,7 @@ import {
setContainerID,
setLoggedInUserId,
} from "../../store/accountDetails/action";
import { setAppealType } from "../../store/appealType/action";
import { setAppealType, setProjectType } from "../../store/appealType/action";
import { setLPA } from "../../store/lpa/action";
import { wrapper } from "../../store/store";
import ServiceBanner from "../../components/myportal/servicebanner";
@@ -61,6 +62,7 @@ const Home = (props) => {
lpadata={props.LPAData}
appealType={props.appealType}
myportal={true}
props={props}
/>
)}
</div>
@@ -93,19 +95,20 @@ export const getServerSideProps = wrapper.getServerSideProps(
},
};
} else {
const [accountDetails, appealTypeData, lpaData] = await Promise.all(
[
const [accountDetails, appealTypeData, lpaData, projectTypeData] =
await Promise.all([
await getPersonalAccount(loggedInUser),
await getAppealsTypes(),
await getLPA(),
]
);
await getProjectTypes(),
]);
//const lpaData = require("../../data/lpa.json");
//const appealTypeData = require("../../data/appealtypes.json");
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setProjectType(projectTypeData));
store.dispatch(setLPA(lpaData));
store.dispatch(setLoggedInUserId(loggedInUser));
@@ -128,7 +131,7 @@ const mapStateToProps = (state) => {
formData: state.formData,
appealType: state.appealType,
LPAData: state.LPAData,
//form: state.form,
form: state.form,
accountDetails: state.accountDetails,
};
};