remove unused imports
This commit is contained in:
@@ -1,45 +1,38 @@
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import {
|
||||
currentViewActionTypes,
|
||||
setCurrentReference,
|
||||
setCurrentPage,
|
||||
} from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import _ from "lodash";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import { getBasicSearchPaged, getAdvancedSearchPaged } from "../../actions";
|
||||
import data from "../../data/collections.json";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useCallback, useState } from "react";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { getAdvancedSearchPaged, getBasicSearchPaged } from "../../actions";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setSearchResults,
|
||||
setSearchDetails,
|
||||
} from "../../store/searchOutput/action";
|
||||
setCurrentPage,
|
||||
setCurrentReference,
|
||||
} from "../../store/currentView/action";
|
||||
|
||||
import { parseCookies, setCookie } from "nookies";
|
||||
import { useEffect } from "react";
|
||||
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||
import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
} from "../../store/searchOutput/action";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
} from "../../store/watchedCases/action";
|
||||
import { useEffect } from "react";
|
||||
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
||||
|
||||
import { getDetailsProxy, getSearchDetailsPaged } from "../utils";
|
||||
import PaginationControl from "./pagination";
|
||||
import {
|
||||
getSearchDetailsPaged,
|
||||
getFormCollection,
|
||||
getFormCollectionByID,
|
||||
} from "../utils";
|
||||
|
||||
import { signIn, useSession } from "next-auth/react";
|
||||
import {
|
||||
createWatchedCases,
|
||||
getWatchedCasesProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
deleteWatchedCases,
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
import { useSession, signIn, signOut } from "next-auth/react";
|
||||
|
||||
const SearchResults = (props) => {
|
||||
const {
|
||||
@@ -94,9 +87,11 @@ const SearchResults = (props) => {
|
||||
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
|
||||
(data) => {
|
||||
setWatchedCases(data),
|
||||
getDetails(data, "myWatchedCases").then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -121,45 +116,15 @@ const SearchResults = (props) => {
|
||||
props.accountDetails.loggedinUserId
|
||||
).then((data) => {
|
||||
setWatchedCases(data),
|
||||
getDetails(data, "myWatchedCases").then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const getDetails = (resultsObj, detailsType) => {
|
||||
//console.log(resultsObj);
|
||||
let detailsArr = [];
|
||||
resultsObj = resultsObj.value;
|
||||
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
console.log(
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
);
|
||||
} else {
|
||||
detailsArr.push(
|
||||
getPortalModuleDetailsProxy(
|
||||
getFormCollectionByID(
|
||||
searchDetail.pinswg_appealcasetype
|
||||
).LogicalCollectionName,
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
//console.log(detailsArr);
|
||||
return Promise.all(detailsArr);
|
||||
};
|
||||
|
||||
const ResultsView = (resultsArr) => {
|
||||
return (
|
||||
<>
|
||||
@@ -721,9 +686,11 @@ const SearchResults = (props) => {
|
||||
props.accountDetails.loggedinUserId
|
||||
).then((data) => {
|
||||
setWatchedCases(data),
|
||||
getDetails(data, "myWatchedCases").then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user