Preserve group on upsert RPS-49.

This commit is contained in:
Patrick Fic
2020-11-19 14:55:12 -08:00
parent 131d71cfcc
commit 5b8bea3714

View File

@@ -16,13 +16,6 @@ export async function UpsertEstimate(job) {
const shopId = store.getState().user.bodyshop.id;
logger.info("Beginning Upserting job from Renderer.");
const parsedYr = parseInt(job.v_model_yr);
logger.info(
"Job Loss Date",
job.loss_date,
"Parsed Year",
moment(job.loss_date).year() -
(parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr)
);
job = {
...job,
@@ -46,14 +39,16 @@ export async function UpsertEstimate(job) {
job.joblines.data
);
logger.info("Attemping to update job record.");
logger.info("Attemping to update job lines.");
await client.mutate({
mutation: gql`
${suppDelta}
`,
});
delete job.joblines;
delete job.group; //Added to preserve group already set in the system RPS-49.
logger.info("Attemping to update job.");
await client.mutate({
mutation: UPDATE_JOB,
variables: { jobId: existingJobs.data.jobs[0].id, job: job },