add api_root and removed token calls from methods

This commit is contained in:
2022-01-12 12:10:32 +00:00
parent 23ba04678f
commit d6135a8109
29 changed files with 286 additions and 136 deletions
@@ -22,7 +22,7 @@ const hashAPIPath = (queryPath) => {
export default async function ApiProxy(req, res) {
var caseReference = req.query.caseReference;
var token = req.query.token;
var token = await getToken();
var queryUrl =
"pinswg_dnses?$filter=pinswg_name eq '" +
@@ -32,7 +32,7 @@ export default async function ApiProxy(req, res) {
return axios
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
azureHeadersPaged(token)
azureHeaders(token.access_token)
)
.then(({ data }) => {
res.status(200).json(data);