Resolve payment refetch.
This commit is contained in:
@@ -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) {
|
if (enterAgain) {
|
||||||
const prev = form.getFieldsValue(["date"]);
|
const prev = form.getFieldsValue(["date"]);
|
||||||
@@ -165,13 +171,7 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur
|
|||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Form
|
<Form onFinish={handleFinish} autoComplete={"off"} form={form} layout="vertical" disabled={context?.exportedat}>
|
||||||
onFinish={handleFinish}
|
|
||||||
autoComplete={"off"}
|
|
||||||
form={form}
|
|
||||||
layout="vertical"
|
|
||||||
disabled={context?.exportedat}
|
|
||||||
>
|
|
||||||
<PaymentForm form={form} />
|
<PaymentForm form={form} />
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export function PaymentsListPaginated({
|
|||||||
}
|
}
|
||||||
: refetch
|
: refetch
|
||||||
},
|
},
|
||||||
context: apolloResults ? apolloResults : record
|
context: { ...(apolloResults ? apolloResults : record), refetchRequiresContext: true }
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user