refactor phase 3 targeted actions imports

This commit is contained in:
2026-03-12 07:39:06 +00:00
parent 2950ce788a
commit aeec5e0f59
6 changed files with 33 additions and 33 deletions
+16 -19
View File
@@ -18,12 +18,9 @@
import axios from "axios";
import CryptoJS from "crypto-js";
import _ from "lodash";
import {
azureHeaders,
consoleLogger,
getToken,
getPreferredLanguage,
} from "../../../actions";
import { azureHeaders } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { getToken } from "../../../actions/core/token";
const WORDKEY = process.env.HASHKEY;
@@ -55,19 +52,19 @@ export default async function ApiProxy(req, res) {
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;
}