Check for existing scrub results & add beta terms.
This commit is contained in:
@@ -4,14 +4,16 @@ import _ from "lodash";
|
||||
import client from "../graphql/GraphQLClient";
|
||||
import { INSERT_NEW_JOB, QUERY_CLOSE_DATE_BY_CLM_NO, QUERY_JOB_BY_CLM_NO, UPDATE_JOB } from "../graphql/jobs.queries";
|
||||
import { QUERY_GROUPS_BY_MAKE_TYPE } from "../graphql/veh_group.queries";
|
||||
import ipcTypes from "../ipc.types";
|
||||
import { clearEsResults } from "../redux/application/application.actions.js";
|
||||
import { store } from "../redux/store";
|
||||
import TrucksList from "./trucks.json";
|
||||
import { WhichRulesetToApply } from "../util/constants.js";
|
||||
import dayjs from "../util/day.js";
|
||||
import CargoVanList from "./cargovans.json";
|
||||
import PassengerVanList from "./passengervans.json";
|
||||
import SuvList from "./suvs.json";
|
||||
import ipcTypes from "../ipc.types";
|
||||
import dayjs from "../util/day.js";
|
||||
import { WhichRulesetToApply } from "../util/constants.js";
|
||||
import TrucksList from "./trucks.json";
|
||||
|
||||
const { logger } = window;
|
||||
const { ipcRenderer } = window;
|
||||
|
||||
@@ -46,6 +48,7 @@ export async function GetR4PDateWithClaim(clm_no) {
|
||||
|
||||
export async function UpsertEstimate(job) {
|
||||
const shopId = store.getState().user.bodyshop.id;
|
||||
|
||||
//logger.info("Beginning Upserting job from Renderer.");
|
||||
ipcRenderer.send(ipcTypes.app.toMain.log.info, "Beginning Upserting job from Renderer.");
|
||||
const existingJobs = await client.query({
|
||||
@@ -88,6 +91,12 @@ export async function UpsertEstimate(job) {
|
||||
//This will now only preserve theg roup if it didn't require a re-import. If it did, reset the group.
|
||||
}
|
||||
|
||||
const currentScrubbedjobId = store.getState().application.esResults.jobid;
|
||||
|
||||
if (currentScrubbedjobId && currentScrubbedjobId === existingJobs.data.jobs[0].id) {
|
||||
store.dispatch(clearEsResults());
|
||||
}
|
||||
|
||||
logger.info("Attemping to update job.");
|
||||
await client.mutate({
|
||||
mutation: UPDATE_JOB,
|
||||
|
||||
Reference in New Issue
Block a user