TASK22057: phase18 additional consolidation slices

This commit is contained in:
2026-03-14 06:52:17 +00:00
parent daa38d6459
commit fffe1d19dd
15 changed files with 460 additions and 66 deletions
+18 -14
View File
@@ -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;
}