Merged PR 2442: remove lodash dependecies on _.has
Related work items: #23754
This commit is contained in:
@@ -47,10 +47,10 @@
|
||||
// * description: Success
|
||||
// */
|
||||
|
||||
import _ from "lodash";
|
||||
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
|
||||
import { respondError } from "../middleware/apiResponse";
|
||||
import { relayGet } from "../middleware/relayForwarding";
|
||||
import { hasOwn } from "../../../components/utils";
|
||||
import { RELAY_POLICY_SEARCH_PAGED } from "../middleware/relayPolicyPresets";
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
@@ -109,7 +109,7 @@ export default async function ApiProxy(req, res) {
|
||||
var queryString = "";
|
||||
|
||||
queryString +=
|
||||
_.has(searchString, "q") && searchString.q != null
|
||||
hasOwn(searchString, "q") && searchString.q != null
|
||||
? "(contains(title, '" +
|
||||
searchString.q.replace(/\'/g, "''") +
|
||||
"') or contains(ticketnumber,'" +
|
||||
@@ -118,25 +118,25 @@ export default async function ApiProxy(req, res) {
|
||||
: "";
|
||||
|
||||
queryString +=
|
||||
_.has(searchString, "lpaRef") && searchString.lpaRef != null
|
||||
hasOwn(searchString, "lpaRef") && searchString.lpaRef != null
|
||||
? "(contains(pinswg_lpareference, '" +
|
||||
searchString.lpaRef.replace(/\'/g, "''") +
|
||||
"')) and"
|
||||
: "";
|
||||
|
||||
queryString +=
|
||||
(_.has(searchString, "lpa") || _.has(searchString, "LPA")) &&
|
||||
(hasOwn(searchString, "lpa") || hasOwn(searchString, "LPA")) &&
|
||||
searchString.lpa != null
|
||||
? " _pinswg_associatedlpa_value eq " + searchString.lpa + " and"
|
||||
: "";
|
||||
|
||||
queryString +=
|
||||
_.has(searchString, "apt") && searchString.apt != null
|
||||
hasOwn(searchString, "apt") && searchString.apt != null
|
||||
? " pinswg_appealcasetype eq " + searchString.apt + " and"
|
||||
: "";
|
||||
|
||||
queryString +=
|
||||
_.has(searchString, "statuscode") && searchString.statuscode != null
|
||||
hasOwn(searchString, "statuscode") && searchString.statuscode != null
|
||||
? " statuscode eq " + searchString.statuscode + " and"
|
||||
: "";
|
||||
|
||||
@@ -152,7 +152,7 @@ export default async function ApiProxy(req, res) {
|
||||
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
|
||||
if (_.has(searchString, "projecttype")) {
|
||||
if (hasOwn(searchString, "projecttype")) {
|
||||
const sipsFilters = [
|
||||
"pinswg_sips_pinswg_sipsprojecttype/any(pt: pt/pinswg_sipsprojecttypeid eq " +
|
||||
searchString.projecttype +
|
||||
@@ -215,7 +215,7 @@ export default async function ApiProxy(req, res) {
|
||||
relayPolicy,
|
||||
transformData: (data) => {
|
||||
let dataStr;
|
||||
_.has(data, "@odata.nextLink") === true &&
|
||||
hasOwn(data, "@odata.nextLink") === true &&
|
||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||
(data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user