Add API key to estimate scrubber.
This commit is contained in:
@@ -4,6 +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")
|
||||
|
||||
// Function to write job object to logs subfolder
|
||||
async function writeJobToLogsFolder(job, fileName) {
|
||||
@@ -35,9 +36,11 @@ async function ScrubEstimate({ job }) {
|
||||
//No secret or private information is exposed.
|
||||
const basicAuthUser = "Imex2";
|
||||
const basicAuthpassword = "Patrick";
|
||||
const estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems";
|
||||
const currentChannel = autoUpdater.channel
|
||||
const estimateScrubberUrl = process.env.NODE_ENV !== undefined || currentChannel === 'alpha' ? 'https://4284-79073.el-alt.com/api/sendems' : "https://insurtechtoolkit.com/api/sendems";
|
||||
console.log("*** ~ ScrubEstimate ~ process.env.NODE_ENV:", process.env.NODE_ENV);
|
||||
const sendingEntityId = "87330f61-412b-4251-baaa-d026565b23c5";
|
||||
try {
|
||||
try { const esApiKey = job?.bodyshop?.es_api_key
|
||||
//Perform data manipulation on the job object
|
||||
if (!job) {
|
||||
console.error("No job provided to ScrubEstimate");
|
||||
@@ -105,7 +108,7 @@ async function ScrubEstimate({ job }) {
|
||||
username: basicAuthUser,
|
||||
password: basicAuthpassword
|
||||
},
|
||||
headers: formData.getHeaders ? formData.getHeaders() : {}
|
||||
headers: { ...formData.getHeaders ? formData.getHeaders() : {}, 'APIkey': esApiKey }
|
||||
});
|
||||
|
||||
const resultPDFUrl = result?.data?.report_link;
|
||||
|
||||
Reference in New Issue
Block a user