Resole ES api urls.

This commit is contained in:
Patrick FIc
2025-09-25 09:29:40 -07:00
parent 2ee06878cc
commit 7f4061bc30
3 changed files with 24 additions and 10 deletions

4
.gitignore vendored
View File

@@ -110,3 +110,7 @@ firebase/.env
# Sentry Auth Token
.sentryclirc
deploy.ps1
macbuild.sh

View File

@@ -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;

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS",
"version": "1.4.2-beta.6",
"version": "1.4.2-beta.7",
"main": "electron/main.js",
"homepage": "./",
"dependencies": {