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
+5 -2
View File
@@ -19,7 +19,7 @@ const hashAPIPath = (queryPath) => {
export default async function ApiProxy(req, res) {
var contactid = req.query.contactid;
var token = req.query.token;
var token = await getToken();
var queryUrl =
"contacts(" +
@@ -27,7 +27,10 @@ export default async function ApiProxy(req, res) {
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode&$count=true";
return axios
.get(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl), azureHeaders(token))
.get(
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
azureHeaders(token.access_token)
)
.then(({ data }) => {
res.status(200).json(data);
})