From 2b635ba3bfbe9a9cd550a147110ae17857928cee Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 9 Dec 2021 17:06:19 -0800 Subject: [PATCH] Revert "IO-1567 Resolve refretch on export." This reverts commit cd191dae70a6194b7a074dd72296bec7c90c6259. --- .../jobs-close-export-button.component.jsx | 14 +++++++++----- .../jobs-export-all-button.component.jsx | 4 +--- .../payable-export-all-button.component.jsx | 4 +--- .../payable-export-button.component.jsx | 4 +--- .../payment-export-button.component.jsx | 4 +--- .../payments-export-all-button.component.jsx | 4 +--- 6 files changed, 14 insertions(+), 20 deletions(-) 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 ea1b6c870..8d783557e 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 @@ -15,6 +15,7 @@ import { logImEXEvent } from "../../firebase/firebase.utils"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { useHistory } from "react-router-dom"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, currentUser: selectCurrentUser, @@ -29,7 +30,7 @@ export function JobsCloseExportButton({ }) { const history = useHistory(); const { t } = useTranslation(); - const [updateJob] = useMutation(UPDATE_JOB, {}); + const [updateJob] = useMutation(UPDATE_JOB); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); const [loading, setLoading] = useState(false); @@ -45,9 +46,13 @@ export function JobsCloseExportButton({ //Check if it's a QBO Setup. let PartnerResponse; if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { - PartnerResponse = await axios.post(`/qbo/receivables`, { - jobIds: [jobId], - }); + PartnerResponse = await axios.post( + `/qbo/receivables`, + { + jobIds: [jobId], + }, + + ); } else { //Default is QBD @@ -150,7 +155,6 @@ export function JobsCloseExportButton({ date_exported: new Date(), }, }, - refetchQueries: ["QUERY_JOBS_FOR_EXPORT "], }); if (!jobUpdateResponse.errors) { 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 074b312cc..80aa92f7f 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 @@ -28,9 +28,7 @@ export function JobsExportAllButton({ completedCallback, }) { const { t } = useTranslation(); - const [updateJob] = useMutation(UPDATE_JOBS, { - refetchQueries: ["QUERY_JOBS_FOR_EXPORT "], - }); + const [updateJob] = useMutation(UPDATE_JOBS); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); const [loading, setLoading] = useState(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 cb0593ec4..0cfe607df 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 @@ -29,9 +29,7 @@ export function PayableExportAll({ completedCallback, }) { const { t } = useTranslation(); - const [updateBill] = useMutation(UPDATE_BILLS, { - refetchQueries: ["QUERY_BILLS_FOR_EXPORT "], - }); + const [updateBill] = useMutation(UPDATE_BILLS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); 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 4b3135a26..17a2acedb 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 @@ -28,9 +28,7 @@ export function PayableExportButton({ setSelectedBills, }) { const { t } = useTranslation(); - const [updateBill] = useMutation(UPDATE_BILLS, { - refetchQueries: ["QUERY_BILLS_FOR_EXPORT "], - }); + const [updateBill] = useMutation(UPDATE_BILLS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); 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 4927ca3d9..0d50032c4 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 @@ -28,9 +28,7 @@ export function PaymentExportButton({ setSelectedPayments, }) { const { t } = useTranslation(); - const [updatePayment] = useMutation(UPDATE_PAYMENTS, { - refetchQueries: ["QUERY_PAYMENTS_FOR_EXPORT "], - }); + const [updatePayment] = useMutation(UPDATE_PAYMENTS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); 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 c8f769ec4..b24536210 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 @@ -27,9 +27,7 @@ export function PaymentsExportAllButton({ completedCallback, }) { const { t } = useTranslation(); - const [updatePayments] = useMutation(UPDATE_PAYMENTS, { - refetchQueries: ["QUERY_PAYMENTS_FOR_EXPORT "], - }); + const [updatePayments] = useMutation(UPDATE_PAYMENTS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);