Merged in feature/IO-2368-QBO-Successful-Export (pull request #964)
IO-2368 Update Cache on QBD posting success
This commit is contained in:
@@ -156,6 +156,18 @@ export function JobsCloseExportButton({
|
|||||||
date_exported: new Date(),
|
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) {
|
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);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,18 @@ export function JobsExportAllButton({
|
|||||||
date_exported: new Date(),
|
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) {
|
if (!jobUpdateResponse.errors) {
|
||||||
@@ -182,7 +194,7 @@ export function JobsExportAllButton({
|
|||||||
|
|
||||||
if (!!completedCallback) completedCallback([]);
|
if (!!completedCallback) completedCallback([]);
|
||||||
if (!!loadingCallback) loadingCallback(false);
|
if (!!loadingCallback) loadingCallback(false);
|
||||||
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch();
|
// if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) refetch();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,18 @@ export function PayableExportAll({
|
|||||||
exported_at: new Date(),
|
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) {
|
if (!!!billUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
|
|||||||
@@ -151,6 +151,18 @@ export function PayableExportButton({
|
|||||||
exported_at: new Date(),
|
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) {
|
if (!!!billUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
|
|||||||
@@ -150,6 +150,18 @@ export function PaymentExportButton({
|
|||||||
exportedat: new Date(),
|
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) {
|
if (!!!paymentUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
|
|||||||
@@ -135,6 +135,18 @@ export function PaymentsExportAllButton({
|
|||||||
exportedat: new Date(),
|
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) {
|
if (!!!paymentUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
|
|||||||
Reference in New Issue
Block a user