cleared debug, updated new appeal add about you

This commit is contained in:
2022-05-31 10:15:03 +01:00
parent 55a9a15a57
commit f2e71c0b54
49 changed files with 161396 additions and 500 deletions
+9 -4
View File
@@ -22,22 +22,27 @@ const hashAPIPath = (queryPath) => {
};
export default async function ApiProxy(req, res) {
var createCaseBody = req.body;
var contactid = req.query.contactid;
var appealTypeId = req.query.appealTypeId;
var lpaID = req.query.lpaID;
var queryUrl = "incidents";
var token = await getToken();
var data = JSON.stringify({
var data = {
"title": "insertion test case",
"caseorigincode": 3,
"servicestage": 1,
"customerid_contact@odata.bind": "/contacts(" + contactid + ")",
"pinswg_appealcasetype": appealTypeId,
"pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")",
});
};
var newData = Object.assign(data, createCaseBody);
console.log(data, WEBAPI_URL + queryUrl);
delete newData.lpaTypes;
delete newData.appealTypes;
console.log("/////Create Case:", newData);
var config = {
method: "post",
@@ -50,7 +55,7 @@ export default async function ApiProxy(req, res) {
"Authorization": "Bearer " + token.access_token,
"Content-Type": "application/json",
},
data: data,
data: JSON.stringify(data),
};
var apiResponse = _.isEmpty(req.query)