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

This commit is contained in:
2026-03-12 10:08:13 +00:00
parent 7bd5c7d833
commit e7882c9f78
10 changed files with 40 additions and 31 deletions
+4 -3
View File
@@ -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)
+4 -4
View File
@@ -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()
+6 -5
View File
@@ -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)
@@ -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)
@@ -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)
+4 -3
View File
@@ -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)
@@ -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;
+4 -3
View File
@@ -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);
+3 -3
View File
@@ -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);
+4 -3
View File
@@ -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)