awaiting submissions from storage acc
This commit is contained in:
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPaged, consoleLogger } from "../../../actions";
|
||||
|
||||
import { getCaseBlob } from "../../../actions/azurestorage";
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
const WEBAPI_URL =
|
||||
@@ -25,6 +25,7 @@ export default async function ApiProxy(req, res) {
|
||||
var createCaseBody = req.body;
|
||||
var contactid = req.query.contactid;
|
||||
var appealTypeId = req.query.appealTypeId;
|
||||
var containerName = req.query.containername;
|
||||
var lpaID = req.query.lpaID;
|
||||
var queryUrl = "incidents";
|
||||
var token = await getToken();
|
||||
@@ -42,7 +43,7 @@ export default async function ApiProxy(req, res) {
|
||||
delete newData.lpaTypes;
|
||||
delete newData.appealTypes;
|
||||
|
||||
console.log("/////Create Case:", newData);
|
||||
console.log("/////Create Case:\n", newData, "\n//////////////");
|
||||
|
||||
var config = {
|
||||
method: "post",
|
||||
@@ -55,18 +56,18 @@ export default async function ApiProxy(req, res) {
|
||||
"Authorization": "Bearer " + token.access_token,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: JSON.stringify(data),
|
||||
data: JSON.stringify(newData),
|
||||
};
|
||||
|
||||
var apiResponse = _.isEmpty(req.query)
|
||||
? res.status(400).json()
|
||||
: axios(config)
|
||||
.then(({ data }) => {
|
||||
console.log(data);
|
||||
getCaseBlob(containerName, data.ticketnumber, createCaseBody);
|
||||
|
||||
res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(consoleLogger(err));
|
||||
//console.log(consoleLogger(err));
|
||||
res.status(400).json(err);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user