TASK22057: phase18 additional consolidation slices
This commit is contained in:
@@ -35,11 +35,14 @@ const hashAPIPath = (queryPath) => {
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
var watchedCaseID = req.query.watchedCaseID;
|
||||
|
||||
if (typeof watchedCaseID === "undefined" || watchedCaseID.length === 0) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var token = await getToken();
|
||||
var queryUrl = "pinswg_watchlists(" + watchedCaseID + ")";
|
||||
|
||||
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
||||
|
||||
var config = {
|
||||
method: "delete",
|
||||
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
|
||||
@@ -39,6 +39,11 @@ const hashAPIPath = (queryPath) => {
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
var emailAddress = req.query.emailAddress;
|
||||
|
||||
if (typeof emailAddress === "undefined" || emailAddress.length === 0) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var token = await getToken();
|
||||
|
||||
var queryUrl =
|
||||
@@ -46,25 +51,24 @@ export default async function ApiProxy(req, res) {
|
||||
emailAddress +
|
||||
"'&$count=true&$select=emailaddress1, contactid";
|
||||
|
||||
console.log(queryUrl);
|
||||
// var queryUrl = "contacts/?$count=true&$select=emailaddress1, contactid";
|
||||
|
||||
var apiResponse = _.isEmpty(req.query)
|
||||
? res.status(400).json()
|
||||
: typeof emailAddress != "undefined" && emailAddress.length > 0
|
||||
? axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeaders(token.access_token)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
res.status(400).json(error);
|
||||
})
|
||||
: res.status(400).json();
|
||||
? axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
azureHeaders(token.access_token)
|
||||
)
|
||||
.then(({ data }) => {
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
res.status(400).json(error);
|
||||
})
|
||||
: res.status(400).json();
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ const groupArray = (arr) => {
|
||||
obj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
], // Change 'name' to 'userName'
|
||||
count: count, // Add 'count' as 'occurrences'
|
||||
count: count // Add 'count' as 'occurrences'
|
||||
};
|
||||
|
||||
result.push(transformedObj);
|
||||
@@ -71,6 +71,11 @@ const groupArray = (arr) => {
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
var incidentID = req.query.incidentid;
|
||||
|
||||
if (typeof incidentID === "undefined" || incidentID.length === 0) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var token = await getToken();
|
||||
|
||||
var queryUrl =
|
||||
@@ -78,8 +83,6 @@ export default async function ApiProxy(req, res) {
|
||||
incidentID +
|
||||
" and not(contains(pinswg_name,'_Appeal_Form.pdf'))&$select=pinswg_name,pinswg_isharedocumentlocations";
|
||||
|
||||
console.log("docu: ", WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
|
||||
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||
|
||||
@@ -56,6 +56,11 @@ const WEBAPI_URL =
|
||||
export default async function ApiProxy(req, res) {
|
||||
var searchString = req.query.searchString;
|
||||
var pageNumber = req.query.pageNumber;
|
||||
|
||||
if (typeof searchString === "undefined" || searchString.length === 0) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var token = await getToken();
|
||||
|
||||
var orderby = req.query.orderby;
|
||||
@@ -84,8 +89,6 @@ export default async function ApiProxy(req, res) {
|
||||
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||
: "");
|
||||
|
||||
console.log("basic search paged:", queryUrl);
|
||||
|
||||
var apiResponse =
|
||||
searchString.length > 0
|
||||
? axios
|
||||
|
||||
@@ -36,6 +36,19 @@ export default async function ApiProxy(req, res) {
|
||||
var token = await getToken();
|
||||
var tempCaseRef = getTempCaseRef();
|
||||
|
||||
if (
|
||||
typeof contactid === "undefined" ||
|
||||
contactid.length === 0 ||
|
||||
typeof appealTypeId === "undefined" ||
|
||||
appealTypeId.length === 0 ||
|
||||
typeof containerName === "undefined" ||
|
||||
containerName.length === 0 ||
|
||||
typeof lpaID === "undefined" ||
|
||||
lpaID.length === 0
|
||||
) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var data = {
|
||||
"title": tempCaseRef,
|
||||
"ticketnumber": tempCaseRef,
|
||||
@@ -53,8 +66,6 @@ export default async function ApiProxy(req, res) {
|
||||
delete newData.lpaTypes;
|
||||
delete newData.appealTypes;
|
||||
|
||||
console.log("/////Create Case:\n", newData, "\n//////////////");
|
||||
|
||||
var newAppealObj = {
|
||||
"pinswg_name": tempCaseRef,
|
||||
"pinswg_appealcasetype": appealTypeId,
|
||||
|
||||
@@ -38,14 +38,11 @@ ApiProxy.get(async (req, res) => {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||
await deleteBlob(
|
||||
containerName,
|
||||
casefolderID + "/files/" + blobName
|
||||
).then((data) => {
|
||||
await deleteBlob(containerName, casefolderID + "/files/" + blobName).then(
|
||||
(data) => {
|
||||
return res.status(200).json({ data: data });
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
||||
@@ -38,14 +38,11 @@ ApiProxy.get(async (req, res) => {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||
await deleteBlob(
|
||||
containerName,
|
||||
casefolderID + "/files/" + blobName
|
||||
).then((data) => {
|
||||
await deleteBlob(containerName, casefolderID + "/files/" + blobName).then(
|
||||
(data) => {
|
||||
return res.status(200).json({ data: data });
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
||||
@@ -42,7 +42,7 @@ export default async function handler(req, res) {
|
||||
const tags = {
|
||||
containerid: json.containerID,
|
||||
caseID: json.ticketnumber,
|
||||
blobType: "Representation",
|
||||
blobType: "Representation"
|
||||
};
|
||||
|
||||
// Convert back to string
|
||||
@@ -53,11 +53,10 @@ export default async function handler(req, res) {
|
||||
updatedContent,
|
||||
Buffer.byteLength(updatedContent),
|
||||
{
|
||||
blobHTTPHeaders: { blobContentType: "application/json" },
|
||||
blobHTTPHeaders: { blobContentType: "application/json" }
|
||||
}
|
||||
);
|
||||
|
||||
console.log("the tags:", tags);
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
|
||||
@@ -65,19 +65,17 @@ ApiProxy.get(async (req, res) => {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||
casefolderID.split("/").length > 1
|
||||
? await getRepsFilesBlobs(
|
||||
containerName,
|
||||
casefolderID.split("/")[0],
|
||||
casefolderID.split("/")[1]
|
||||
).then((data) => {
|
||||
return res.status(200).json({ "value": [data] });
|
||||
})
|
||||
: await getBlobs(containerName, casefolderID).then((data) => {
|
||||
return res.status(200).json({ "value": [data] });
|
||||
});
|
||||
}
|
||||
casefolderID.split("/").length > 1
|
||||
? await getRepsFilesBlobs(
|
||||
containerName,
|
||||
casefolderID.split("/")[0],
|
||||
casefolderID.split("/")[1]
|
||||
).then((data) => {
|
||||
return res.status(200).json({ "value": [data] });
|
||||
})
|
||||
: await getBlobs(containerName, casefolderID).then((data) => {
|
||||
return res.status(200).json({ "value": [data] });
|
||||
});
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
||||
@@ -37,19 +37,13 @@ ApiProxy.get(async (req, res) => {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
|
||||
const blobObj = await getProgressBlobs(containerName, casefolderID)
|
||||
.then((data) => {
|
||||
return downloadProgressFile(
|
||||
containerName,
|
||||
data.path,
|
||||
casefolderID
|
||||
);
|
||||
})
|
||||
.then((data) => {
|
||||
return res.status(200).json(data);
|
||||
});
|
||||
}
|
||||
await getProgressBlobs(containerName, casefolderID)
|
||||
.then((data) => {
|
||||
return downloadProgressFile(containerName, data.path, casefolderID);
|
||||
})
|
||||
.then((data) => {
|
||||
return res.status(200).json(data);
|
||||
});
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
||||
@@ -29,6 +29,19 @@ export default async function ApiProxy(req, res) {
|
||||
var updateFormCollection = req.query.updateFormCollection;
|
||||
var queryUrl = updateFormCollection + "(" + appealObj + ")";
|
||||
|
||||
if (
|
||||
typeof updateFormCollection === "undefined" ||
|
||||
updateFormCollection.length === 0 ||
|
||||
typeof appealObj === "undefined" ||
|
||||
appealObj.length === 0 ||
|
||||
typeof incidentID === "undefined" ||
|
||||
incidentID.length === 0 ||
|
||||
typeof req.body === "undefined" ||
|
||||
req.body === null
|
||||
) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
var token = await getToken();
|
||||
|
||||
var config = {
|
||||
|
||||
Reference in New Issue
Block a user