diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 1724e00f..00fa889b 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -86,6 +86,27 @@ const SearchResults = (props) => { const cookies = parseCookies(); + const selectWatchedCase = (loggedInUser, incidentID, appealType) => { + let updateBody = { + "pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")", + "pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")", + "pinswg_appealcasetype": +appealType, + }; + + createWatchedCases(updateBody) + .then((data) => data) + .then(() => { + getWatchedCasesProxy(props.accountDetails.loggedinUserId).then( + (data) => { + setWatchedCases(data), + getDetails(data, "myWatchedCases").then((data) => { + setWatchedCasesDetails(data); + }); + } + ); + }); + }; + const isWatchedCase = (whichIncident) => { let isWatched = jsonpath.query( watchedCases, diff --git a/package.json b/package.json index b13fc262..570ed08e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "multiparty": "^4.2.3", "mysql": "^2.18.1", "nanoid": "^3.2.0", - "next": "13.4", + "next": "^14.0.1", "next-auth": "^4.22.1", "next-connect": "^0.12.2", "next-redux-wrapper": "^7.0.5", diff --git a/pages/_document.js b/pages/_document.js index 324db990..b7976a35 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -64,23 +64,27 @@ class MyDocument extends Document { )} {!process.browser && ( <> - - + + > )} - {typeof window !== "undefined" && ( - <> -