diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index f18bd25d7..add61d4cf 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -156,6 +156,18 @@ export function JobsCloseExportButton({ date_exported: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + jobs(existingJobs = []) { + return existingJobs.filter( + (jobRef) => jobRef.__ref.includes(jobId) === false + ); + }, + }, + }); + }, }); if (!jobUpdateResponse.errors) { @@ -185,7 +197,7 @@ export function JobsCloseExportButton({ }); } } - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch(); + //if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch(); setLoading(false); }; diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index 2f5878351..78d573d2c 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -153,6 +153,18 @@ export function JobsExportAllButton({ date_exported: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + jobs(existingJobs = []) { + return existingJobs.filter( + (jobRef) => jobRef.__ref.includes([key]) === false + ); + }, + }, + }); + }, }); if (!jobUpdateResponse.errors) { @@ -182,7 +194,7 @@ export function JobsExportAllButton({ if (!!completedCallback) completedCallback([]); if (!!loadingCallback) loadingCallback(false); - if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch(); + // if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch(); setLoading(false); }; diff --git a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx index 7596dea7c..16ba8dc39 100644 --- a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx +++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx @@ -148,6 +148,18 @@ export function PayableExportAll({ exported_at: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + bills(existingJobs = []) { + return existingJobs.filter( + (billRef) => billRef.__ref.includes([key]) === false + ); + }, + }, + }); + }, }); if (!!!billUpdateResponse.errors) { notification.open({ diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index fc5254073..d42c67eeb 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -151,6 +151,18 @@ export function PayableExportButton({ exported_at: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + bills(existingJobs = []) { + return existingJobs.filter( + (billRef) => billRef.__ref.includes(billId) === false + ); + }, + }, + }); + }, }); if (!!!billUpdateResponse.errors) { notification.open({ diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index 471e2389e..534516275 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -150,6 +150,18 @@ export function PaymentExportButton({ exportedat: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + payments(existingJobs = []) { + return existingJobs.filter( + (paymentRef) => paymentRef.__ref.includes(paymentId) === false + ); + }, + }, + }); + }, }); if (!!!paymentUpdateResponse.errors) { notification.open({ diff --git a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx index e4218cc3b..c62965cd6 100644 --- a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx +++ b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx @@ -135,6 +135,18 @@ export function PaymentsExportAllButton({ exportedat: new Date(), }, }, + update(cache) { + cache.modify({ + id: "ROOT_QUERY", + fields: { + payments(existingJobs = []) { + return existingJobs.filter( + (paymentRef) => paymentRef.__ref.includes([key]) === false + ); + }, + }, + }); + }, }); if (!!!paymentUpdateResponse.errors) { notification.open({