refactor phase 3a api-endpoint chunk 5a targeted actions imports

This commit is contained in:
2026-03-12 11:31:38 +00:00
parent 86f41f81e9
commit 2a3c7eac34
6 changed files with 44 additions and 33 deletions
+20 -18
View File
@@ -24,7 +24,9 @@
import axios from "axios";
import CryptoJS from "crypto-js";
import _ from "lodash";
import { azureHeadersPaged, consoleLogger, getToken } from "../../../actions";
import { azureHeadersPaged } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { getToken } from "../../../actions/core/token";
const WORDKEY = process.env.HASHKEY;
@@ -58,23 +60,23 @@ export default async function ApiProxy(req, res) {
var apiResponse = _.isEmpty(req.query)
? res.status(400).json()
: typeof emailAddress != "undefined" &&
emailAddress.length > 0 &&
typeof pwd != "undefined" &&
pwd.length > 0
? axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
azureHeadersPaged(token.access_token)
)
.then(({ data }) => {
console.log(data);
res.status(200).json(data);
})
.catch((error) => {
consoleLogger(error);
res.status(400).json(error);
})
: res.status(400).json();
emailAddress.length > 0 &&
typeof pwd != "undefined" &&
pwd.length > 0
? axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
azureHeadersPaged(token.access_token)
)
.then(({ data }) => {
console.log(data);
res.status(200).json(data);
})
.catch((error) => {
consoleLogger(error);
res.status(400).json(error);
})
: res.status(400).json();
return apiResponse;
}