update jsonpath library
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
@@ -20,9 +20,9 @@ const Breadcrumbs = (props) => {
|
||||
if (_.isEmpty(courseContent)) {
|
||||
return null;
|
||||
} else {
|
||||
var sectionObj = jsonpath.query(
|
||||
courseContent,
|
||||
'$..sections[?(@.path=="/' + coursePageURL + '")]'
|
||||
var sectionObj = jsonpath(
|
||||
'$..sections[?(@.path=="/' + coursePageURL + '")]',
|
||||
courseContent
|
||||
);
|
||||
var breadcrumb = sectionObj[0].chapter.title; //sectionObj[0].chapter
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user