From 1469960643baefdfb9ababda36d0e493c9f2f837 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 5 Apr 2024 12:52:26 -0700 Subject: [PATCH] Resolve payment refetch. --- .../payment-modal/payment-modal.container.jsx | 16 ++++++++-------- .../payment-list-paginated.component.jsx | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index f993c13b8..eb1c6ff59 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -90,7 +90,13 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur } } - if (actions.refetch) actions.refetch(updatedPayment && updatedPayment.data.update_payments.returning[0]); + if (actions.refetch) { + if (context.refetchRequiresContext) { + actions.refetch(updatedPayment && updatedPayment.data.update_payments.returning[0]); + } else { + actions.refetch(); + } + } if (enterAgain) { const prev = form.getFieldsValue(["date"]); @@ -165,13 +171,7 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur )} -
+ diff --git a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx index 1a5dd6774..e6f0d9822 100644 --- a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx +++ b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx @@ -171,7 +171,7 @@ export function PaymentsListPaginated({ } : refetch }, - context: apolloResults ? apolloResults : record + context: { ...(apolloResults ? apolloResults : record), refetchRequiresContext: true } }); }} >