Added refetch query for shown estimate RPS-68

This commit is contained in:
Patrick Fic
2020-11-27 16:07:24 -08:00
parent f240dc6ccb
commit 4b27a92b8a

View File

@@ -47,11 +47,12 @@ export async function UpsertEstimate(job) {
});
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 },
refetchQueries: ["QUERY_JOB_BY_PK"],
});
logger.info("Job updated succesfully.");
} else {
@@ -62,7 +63,7 @@ export async function UpsertEstimate(job) {
variables: {
job: { ...job, bodyshopid: shopId },
},
refetchQueries: ["QUERY_ALL_JOBS_PAGINATED"],
refetchQueries: ["QUERY_ALL_JOBS_PAGINATED", "QUERY_JOB_BY_PK"],
});
logger.info("Job inserted succesfully.");
}