Resole ES api urls.
This commit is contained in:
@@ -4,7 +4,7 @@ const path = require("path");
|
||||
const { BrowserWindow } = require("electron");
|
||||
const { default: ipcTypes } = require("../../src/ipc.types.commonjs");
|
||||
const { promises: fsPromises } = require("fs");
|
||||
const { autoUpdater } = require("electron-updater")
|
||||
const { autoUpdater } = require("electron-updater");
|
||||
|
||||
// Function to write job object to logs subfolder
|
||||
async function writeJobToLogsFolder(job, fileName) {
|
||||
@@ -36,15 +36,25 @@ async function ScrubEstimate({ job }) {
|
||||
//No secret or private information is exposed.
|
||||
const basicAuthUser = "Imex2";
|
||||
const basicAuthpassword = "Patrick";
|
||||
const currentChannel = autoUpdater.channel
|
||||
const estimateScrubberUrl =
|
||||
process.env.NODE_ENV === undefined ? "https://4284-79287.el-alt.com" : //dev specific URL.
|
||||
currentChannel === 'beta' ? 'https://4284-79073.el-alt.com/api/sendems' //Beta specific URL.
|
||||
: "https://insurtechtoolkit.com/api/sendems"; //Production route.
|
||||
log.debug(`Estimate Scrubber URL: [${currentChannel} |`, estimateScrubberUrl);
|
||||
const currentChannel = autoUpdater.channel;
|
||||
let estimateScrubberUrl;
|
||||
switch (currentChannel) {
|
||||
case "alpha":
|
||||
estimateScrubberUrl = "https://4284-79287.el-alt.com/api/sendems"; //dev specific URL.
|
||||
break;
|
||||
case "beta":
|
||||
estimateScrubberUrl = "https://4284-79073.el-alt.com/api/sendems"; //Beta specific URL.
|
||||
break;
|
||||
default:
|
||||
estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems"; //Production route.
|
||||
break;
|
||||
}
|
||||
|
||||
//const estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems";
|
||||
log.log(`Estimate Scrubber URL: [${currentChannel} |`, estimateScrubberUrl);
|
||||
const sendingEntityId = "87330f61-412b-4251-baaa-d026565b23c5";
|
||||
try {
|
||||
const esApiKey = job?.bodyshop?.es_api_key
|
||||
const esApiKey = job?.bodyshop?.es_api_key;
|
||||
//Perform data manipulation on the job object
|
||||
if (!job) {
|
||||
console.error("No job provided to ScrubEstimate");
|
||||
@@ -112,7 +122,7 @@ async function ScrubEstimate({ job }) {
|
||||
username: basicAuthUser,
|
||||
password: basicAuthpassword
|
||||
},
|
||||
headers: { ...formData.getHeaders ? formData.getHeaders() : {}, 'APIkey': esApiKey }
|
||||
headers: { ...(formData.getHeaders ? formData.getHeaders() : {}), APIkey: esApiKey }
|
||||
});
|
||||
|
||||
const resultPDFUrl = result?.data?.report_link;
|
||||
|
||||
Reference in New Issue
Block a user