refactor phase 3a api-file chunk 1 targeted actions imports
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { hashAPIPath, updateAccount } from "../../../actions";
|
||||
import { updateAccount } from "../../../actions/services/accountService";
|
||||
import {
|
||||
createCaseCompleteMessage,
|
||||
getProgressBlobs,
|
||||
downloadProgressFile,
|
||||
createBlob,
|
||||
getCaseBlob,
|
||||
getCaseBlob
|
||||
} from "../../../actions/azurestorage";
|
||||
import _ from "lodash";
|
||||
|
||||
@@ -44,7 +44,7 @@ ApiProxy.get(async (req, res) => {
|
||||
);
|
||||
|
||||
Object.assign(blobProgress, {
|
||||
"appealComplete": tempCaseRef,
|
||||
"appealComplete": tempCaseRef
|
||||
});
|
||||
|
||||
delete blobProgress["pinswg_name"];
|
||||
@@ -75,7 +75,7 @@ ApiProxy.get(async (req, res) => {
|
||||
"pinswg_lpareference":
|
||||
blobProgress.pinswg_lpaapplicationreference,
|
||||
"description": blobProgress.pinswg_developmentdescription,
|
||||
"pinswg_caseaddress": combinedAddress,
|
||||
"pinswg_caseaddress": combinedAddress
|
||||
});
|
||||
|
||||
//send update case.json and then create queue message
|
||||
@@ -87,7 +87,7 @@ ApiProxy.get(async (req, res) => {
|
||||
updateAccount(
|
||||
contactId[1],
|
||||
{
|
||||
"pinswg_typeofinvolvement": 846040001,
|
||||
"pinswg_typeofinvolvement": 846040001
|
||||
},
|
||||
true
|
||||
).then((data) => {
|
||||
@@ -104,7 +104,7 @@ ApiProxy.get(async (req, res) => {
|
||||
|
||||
createCaseCompleteMessage(containerName, tempCaseRef);
|
||||
return res.status(200).json({
|
||||
status: "success",
|
||||
status: "success"
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -136,8 +136,8 @@ ApiProxy.get(async (req, res) => {
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
bodyParser: false,
|
||||
},
|
||||
bodyParser: false
|
||||
}
|
||||
};
|
||||
|
||||
export default ApiProxy;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPaged, consoleLogger } from "../../../actions";
|
||||
import { azureHeadersPaged } from "../../../actions/core/headers";
|
||||
import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
import { getCaseBlob, createBlob } from "../../../actions/azurestorage";
|
||||
import { getTempCaseRef } from "../../../components/utils";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
@@ -44,7 +46,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);
|
||||
|
||||
@@ -56,7 +58,7 @@ export default async function ApiProxy(req, res) {
|
||||
var newAppealObj = {
|
||||
"pinswg_name": tempCaseRef,
|
||||
"pinswg_appealcasetype": appealTypeId,
|
||||
"_pinswg_associatedlpa_value": lpaID,
|
||||
"_pinswg_associatedlpa_value": lpaID
|
||||
};
|
||||
|
||||
// var 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;
|
||||
|
||||
@@ -45,7 +46,7 @@ export default async function ApiProxy(req, res) {
|
||||
var crmUrl = "https://" + process.env.CRMURL;
|
||||
|
||||
var data = {
|
||||
"@odata.id": crmUrl + "/api/data/v8.2/contacts(" + contactid + ")",
|
||||
"@odata.id": crmUrl + "/api/data/v8.2/contacts(" + contactid + ")"
|
||||
};
|
||||
|
||||
var config = {
|
||||
@@ -58,9 +59,9 @@ export default async function ApiProxy(req, res) {
|
||||
"If-None-Match": "null",
|
||||
"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)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { hashAPIPath } from "../../../actions";
|
||||
import {
|
||||
getBlobs,
|
||||
createRepCompleteMessage,
|
||||
createRepCompleteMessage
|
||||
} from "../../../actions/azurestorage";
|
||||
|
||||
import nextConnect from "next-connect";
|
||||
@@ -38,8 +37,8 @@ ApiProxy.get(async (req, res) => {
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
bodyParser: false,
|
||||
},
|
||||
bodyParser: false
|
||||
}
|
||||
};
|
||||
|
||||
export default ApiProxy;
|
||||
|
||||
@@ -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,7 +48,7 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
var data = {
|
||||
"@odata.id":
|
||||
crmUrl + "/api/data/" + crmVersion + "/contacts(" + contactid + ")",
|
||||
crmUrl + "/api/data/" + crmVersion + "/contacts(" + contactid + ")"
|
||||
};
|
||||
|
||||
var config = {
|
||||
@@ -60,9 +61,9 @@ export default async function ApiProxy(req, res) {
|
||||
"If-None-Match": "null",
|
||||
"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)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
|
||||
@@ -39,9 +40,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);
|
||||
|
||||
Reference in New Issue
Block a user