update jsonpath library
This commit is contained in:
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
|
||||
import ChangePassword from "../../components/account/changepassword";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
|
||||
import RegisterForm from "../../components/account/registerform";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
import { getSession, useSession } from "next-auth/react";
|
||||
import NoSessionWarning from "../../components/nosession";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
|
||||
import PersonalDetails from "../../components/account/personaldetails";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { wrapper } from "../../store/store";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
|
||||
import RegisterForm from "../../components/account/registerform";
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
consoleLogger,
|
||||
getLPA,
|
||||
} from "../../../actions";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -48,7 +48,7 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
const lpaList = await getLPA();
|
||||
|
||||
const lpaGUID = jsonpath.query(lpaList, '$..[?(@.name=="' + lpaid + '")]');
|
||||
const lpaGUID = jsonpath('$..[?(@.name=="' + lpaid + '")]', lpaList);
|
||||
|
||||
console.log(
|
||||
'$..[?(@.name="' + lpaid + '")]',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from "fs";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
@@ -69,11 +69,9 @@ let Home = (props) => {
|
||||
|
||||
let optionsStr = props.appealType.appealTypeOptions.value || {};
|
||||
|
||||
// let selectedObj = jsonpath.query(optionsStr, "$..value");
|
||||
|
||||
let selectedObj = jsonpath.query(
|
||||
optionsStr,
|
||||
"$..[?(@.attributevalue=='" + router.query.apt + "')]"
|
||||
let selectedObj = jsonpath(
|
||||
"$..[?(@.attributevalue=='" + router.query.apt + "')]",
|
||||
optionsStr
|
||||
);
|
||||
|
||||
//let optionsTitleObj = [];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from "fs";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
@@ -69,11 +69,9 @@ let Home = (props) => {
|
||||
|
||||
let optionsStr = props.appealType.appealTypeOptions.value;
|
||||
|
||||
// let selectedObj = jsonpath.query(optionsStr, "$..value");
|
||||
|
||||
let selectedObj = jsonpath.query(
|
||||
optionsStr,
|
||||
"$..[?(@.attributevalue=='" + router.query.apt + "')]"
|
||||
let selectedObj = jsonpath(
|
||||
"$..[?(@.attributevalue=='" + router.query.apt + "')]",
|
||||
optionsStr
|
||||
);
|
||||
|
||||
//let optionsTitleObj = [];
|
||||
|
||||
Reference in New Issue
Block a user