diff --git a/pages/api/endpoint/createaccount_api.js b/pages/api/endpoint/createaccount_api.js index ed5e44b2..d2aa587d 100644 --- a/pages/api/endpoint/createaccount_api.js +++ b/pages/api/endpoint/createaccount_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -46,9 +47,9 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: data, + data: data }; return axios(config) diff --git a/pages/api/endpoint/createcase_api.js b/pages/api/endpoint/createcase_api.js index 122783e6..ee4ba35f 100644 --- a/pages/api/endpoint/createcase_api.js +++ b/pages/api/endpoint/createcase_api.js @@ -44,7 +44,7 @@ import axios from "axios"; import CryptoJS from "crypto-js"; import _ from "lodash"; -import { getToken } from "../../../actions"; +import { getToken } from "../../../actions/core/token"; import { getCaseBlob } from "../../../actions/azurestorage"; const WORDKEY = process.env.HASHKEY; @@ -79,7 +79,7 @@ export default async function ApiProxy(req, res) { "servicestage": 1, "customerid_contact@odata.bind": "/contacts(" + contactid + ")", "pinswg_appealcasetype": appealTypeId, - "pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")", + "pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")" }; var newData = Object.assign(data, createCaseBody); @@ -97,9 +97,9 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: JSON.stringify(newData), + data: JSON.stringify(newData) }; var apiResponse = _.isEmpty(req.query) ? res.status(400).json() diff --git a/pages/api/endpoint/createwatchedcases_api.js b/pages/api/endpoint/createwatchedcases_api.js index 4368899a..56f05b14 100644 --- a/pages/api/endpoint/createwatchedcases_api.js +++ b/pages/api/endpoint/createwatchedcases_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -70,8 +71,8 @@ const recordExists = async (incidentId, contactId, token) => { const res = await axios.get(url, { headers: { Authorization: "Bearer " + token.access_token, - Accept: "application/json", - }, + Accept: "application/json" + } }); if (res.data.value && res.data.value.length > 0) { @@ -113,9 +114,9 @@ export default async function ApiProxy(req, res) { Accept: "application/json", Prefer: 'odata.include-annotations="*",return=representation', Authorization: "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: JSON.stringify(data), + data: JSON.stringify(data) }; return axios(config) diff --git a/pages/api/endpoint/deleteawaitingsubmissions_api.js b/pages/api/endpoint/deleteawaitingsubmissions_api.js index fb878202..23189625 100644 --- a/pages/api/endpoint/deleteawaitingsubmissions_api.js +++ b/pages/api/endpoint/deleteawaitingsubmissions_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -46,8 +47,8 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", - }, + "Content-Type": "application/json" + } }; return axios(config) diff --git a/pages/api/endpoint/deletemyrepresentations_api.js b/pages/api/endpoint/deletemyrepresentations_api.js index 78843c7b..b0c6fadf 100644 --- a/pages/api/endpoint/deletemyrepresentations_api.js +++ b/pages/api/endpoint/deletemyrepresentations_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -46,8 +47,8 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", - }, + "Content-Type": "application/json" + } }; return axios(config) diff --git a/pages/api/endpoint/deletewatchedcases_api.js b/pages/api/endpoint/deletewatchedcases_api.js index 99b55d63..e569e72a 100644 --- a/pages/api/endpoint/deletewatchedcases_api.js +++ b/pages/api/endpoint/deletewatchedcases_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -48,8 +49,8 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", - }, + "Content-Type": "application/json" + } }; return axios(config) diff --git a/pages/api/endpoint/deletewatchedcasesproxy_api.js b/pages/api/endpoint/deletewatchedcasesproxy_api.js index e62bb1eb..72142710 100644 --- a/pages/api/endpoint/deletewatchedcasesproxy_api.js +++ b/pages/api/endpoint/deletewatchedcasesproxy_api.js @@ -19,7 +19,9 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { azureHeaders, consoleLogger, getToken } 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; diff --git a/pages/api/endpoint/updateaccount_api.js b/pages/api/endpoint/updateaccount_api.js index 02aa56a3..f48cf834 100644 --- a/pages/api/endpoint/updateaccount_api.js +++ b/pages/api/endpoint/updateaccount_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { consoleLogger, getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -47,9 +48,9 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: data, + data: data }; console.log(config); diff --git a/pages/api/endpoint/updatecase_api.js b/pages/api/endpoint/updatecase_api.js index 11d9e08d..aa2dc39d 100644 --- a/pages/api/endpoint/updatecase_api.js +++ b/pages/api/endpoint/updatecase_api.js @@ -12,7 +12,7 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { getToken } from "../../../actions"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -51,9 +51,9 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: data, + data: data }; //console.log("update case:", data); diff --git a/pages/api/endpoint/updatepassword_api.js b/pages/api/endpoint/updatepassword_api.js index ceed6018..e8c66a47 100644 --- a/pages/api/endpoint/updatepassword_api.js +++ b/pages/api/endpoint/updatepassword_api.js @@ -12,7 +12,8 @@ import axios from "axios"; import CryptoJS from "crypto-js"; -import { getToken } from "../../../actions"; +import { consoleLogger } from "../../../actions/core/logger"; +import { getToken } from "../../../actions/core/token"; const WORDKEY = process.env.HASHKEY; @@ -47,9 +48,9 @@ export default async function ApiProxy(req, res) { "Accept": "application/json", "Prefer": 'odata.include-annotations="*",return=representation', "Authorization": "Bearer " + token.access_token, - "Content-Type": "application/json", + "Content-Type": "application/json" }, - data: data, + data: data }; return axios(config)