Merge branch 'Development' into SIPS-Development

This commit is contained in:
2025-08-20 12:11:55 +01:00
71 changed files with 1683 additions and 443 deletions
@@ -34,7 +34,7 @@ import CryptoJS from "crypto-js";
import _ from "lodash";
import { azureHeadersPaged, consoleLogger, getToken } from "../../../actions";
import { getSelectQuery } from "../../../actions/selectQueryTypes";
import { getNavigationPropertyByPrimaryAttribute } from "../../../components/utils";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
@@ -59,6 +59,11 @@ export default async function ApiProxy(req, res) {
var incidentID = req.query.incidentID;
var token = await getToken();
let navigationProperty =
getNavigationPropertyByPrimaryAttribute(
primaryIdAttribute
).NavigationProperty;
var queryUrl =
appealTypeName +
"?$filter=_" +
@@ -67,7 +72,11 @@ export default async function ApiProxy(req, res) {
: primaryIdAttribute + "s_value ") +
" eq " +
incidentID +
"&$count=true";
"&$count=true" +
"&$expand=" +
navigationProperty +
"($select=ticketnumber)";
//" and statuscode eq 1&$count=true";
queryUrl =
@@ -86,10 +95,18 @@ export default async function ApiProxy(req, res) {
azureHeadersPaged(token.access_token)
)
.then(({ data }) => {
let flattened = data.value.map((r) => ({
...r,
ticketnumber: r[navigationProperty]?.ticketnumber || null,
}));
data.value = flattened;
var dataStr;
_.has(data, "@odata.nextLink") == true &&
((dataStr = JSON.stringify(data["@odata.nextLink"])),
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
return res.status(200).json(data);
})
.catch((error) => {