added column sort and arrows

This commit is contained in:
2022-01-28 19:35:07 +00:00
parent 2ac0b0ade4
commit 9d55adb26d
9 changed files with 173 additions and 24 deletions
+17 -8
View File
@@ -42,27 +42,36 @@ export default async function ApiProxy(req, res) {
var docRef = req.query;
console.log(docRef.id);
var queryUrl = "documents/download/" + docRef.id + "?hash=" + docRef.hash;
console.log(WEBAPI_URL + queryUrl);
const configDocument = (access_token) => {
return {
headers: {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json",
"Prefer": 'odata.include-annotations="*",return=representation',
"Content-Type": "application/json",
"Authorization": "Bearer " + access_token,
},
responseType: "arraybuffer",
};
};
return axios
.get(
WEBAPI_URL + queryUrl, // + hashAPIPath(queryUrl),
azureHeadersPaged(token.access_token)
configDocument(token.access_token)
)
.then((response) => {
console.log(response.headers);
res.status(200);
res.setHeader(
"Content-disposition",
"content-disposition",
"attachment; filename=" +
response.headers["content-disposition"].split(
"filename="
)[1]
);
res.end(response.data);
res.status(200).send(response.data);
})
.catch(({ err }) => {
res.status(400).json(err);
@@ -27,6 +27,8 @@ export default async function ApiProxy(req, res) {
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=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
console.log(queryUrl);
return axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
+2
View File
@@ -32,6 +32,8 @@ export default async function ApiProxy(req, res) {
searchString +
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
console.log("basic query ", queryUrl);
var apiResponse = _.isEmpty(req.query)
? res.status(400).json()
: searchString.length > 0
+10 -1
View File
@@ -24,16 +24,25 @@ export default async function ApiProxy(req, res) {
var pageNumber = req.query.pageNumber;
var token = await getToken();
var orderby = req.query.orderby;
var fieldSort = req.query.fieldSort;
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, '" +
searchString +
"') or contains(ticketnumber, '" +
searchString +
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true" +
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" +
orderby +
" " +
fieldSort +
"&$count=true" +
(typeof pageNumber != "undefined"
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
: "");
console.log(queryUrl);
var apiResponse =
searchString.length > 0
? axios