update jsonpath library

This commit is contained in:
2024-02-08 14:28:40 +00:00
parent f034f4be3d
commit 2af463fbe9
67 changed files with 961 additions and 966 deletions
+7 -7
View File
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { useState, useEffect, useRef } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import { JSONPath as jsonpath } from "jsonpath-plus";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
@@ -61,11 +61,11 @@ const RepresentationList = (props) => {
</div>
{representationsArr.map((item, key) => {
let detailsObj = jsonpath.query(
item,
let detailsObj = jsonpath(
"$..[?(@.pinswg_representationsid=='" +
incidentid +
"')]"
"')]",
item
);
detailsObj = item;
@@ -91,13 +91,13 @@ const RepresentationList = (props) => {
</span>
{router.locale == "cy"
? jsonpath.query(
transLookup,
? jsonpath(
'$..[?(@.value=="' +
detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy'
'")].value_cy',
transLookup
)
: detailsObj[
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"