select number records returned
This commit is contained in:
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import { query } from "jsonpath";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||
import { getToken, azureHeadersPagedCustom } from "../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -29,6 +29,7 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
var orderby = req.query.orderby;
|
||||
var fieldSort = req.query.fieldSort;
|
||||
var showNumberOfRecords = req.query.showNumberOfRecords;
|
||||
|
||||
searchString = _.isEmpty(searchString)
|
||||
? searchString
|
||||
@@ -80,7 +81,10 @@ export default async function ApiProxy(req, res) {
|
||||
: axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token.access_token)
|
||||
azureHeadersPagedCustom(
|
||||
token.access_token,
|
||||
showNumberOfRecords
|
||||
)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
var dataStr;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||
import { getToken, azureHeadersPagedCustom } from "../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -26,6 +26,7 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
var orderby = req.query.orderby;
|
||||
var fieldSort = req.query.fieldSort;
|
||||
var showNumberOfRecords = req.query.showNumberOfRecords;
|
||||
|
||||
var queryUrl =
|
||||
"incidents?$select=description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=(contains(title, '" +
|
||||
@@ -48,7 +49,10 @@ export default async function ApiProxy(req, res) {
|
||||
? axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token.access_token)
|
||||
azureHeadersPagedCustom(
|
||||
token.access_token,
|
||||
showNumberOfRecords
|
||||
)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
var dataStr;
|
||||
|
||||
@@ -43,7 +43,7 @@ export default async function ApiProxy(req, res) {
|
||||
incidentID +
|
||||
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference";
|
||||
|
||||
console.log("docu: ", queryUrl);
|
||||
console.log("docu: ", WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
||||
|
||||
return axios
|
||||
.get(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||
import { getToken, azureHeadersPagedCustom } from "../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -41,9 +41,10 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
var orderby = req.query.orderby;
|
||||
var fieldSort = req.query.fieldSort;
|
||||
var showNumberOfRecords = req.query.showNumberOfRecords;
|
||||
|
||||
var queryUrl =
|
||||
"pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||
"pinswg_documents?$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||
incidentID +
|
||||
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference&$orderby=" +
|
||||
orderby +
|
||||
@@ -54,12 +55,12 @@ export default async function ApiProxy(req, res) {
|
||||
? "&$skiptoken=" + ('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
|
||||
console.log("docu: ", queryUrl);
|
||||
console.log("docu paged: ", queryUrl);
|
||||
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeadersPaged(token.access_token)
|
||||
azureHeadersPagedCustom(token.access_token, showNumberOfRecords)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
data.value.forEach(function (element) {
|
||||
|
||||
Reference in New Issue
Block a user