Resolve ES Lint error.
This commit is contained in:
@@ -8,16 +8,18 @@ import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
|||||||
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
|
import { selectPayment } from "../../redux/modals/modals.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser
|
currentUser: selectCurrentUser,
|
||||||
|
paymentModal: selectPayment
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setPaymentContext: (context) => dispatch(setModalContext({ context: context, modal: "payment" }))
|
setPaymentContext: (context) => dispatch(setModalContext({ context: context, modal: "payment" }))
|
||||||
});
|
});
|
||||||
|
|
||||||
const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentContext, currentUser }) => {
|
const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentContext, currentUser, paymentModal }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [insertExportLog, { loading: exportLogLoading }] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog, { loading: exportLogLoading }] = useMutation(INSERT_EXPORT_LOG);
|
||||||
const [updatePayment, { loading: updatePaymentLoading }] = useMutation(UPDATE_PAYMENT);
|
const [updatePayment, { loading: updatePaymentLoading }] = useMutation(UPDATE_PAYMENT);
|
||||||
@@ -56,13 +58,14 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont
|
|||||||
refetch
|
refetch
|
||||||
},
|
},
|
||||||
context: {
|
context: {
|
||||||
|
...paymentModal.context,
|
||||||
...payment,
|
...payment,
|
||||||
exportedat: today
|
exportedat: today
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (refetch) {
|
if (refetch) {
|
||||||
if (context.refetchRequiresContext) {
|
if (paymentModal.context.refetchRequiresContext) {
|
||||||
refetch(paymentUpdateResponse && paymentUpdateResponse.data.update_payments.returning[0]);
|
refetch(paymentUpdateResponse && paymentUpdateResponse.data.update_payments.returning[0]);
|
||||||
} else {
|
} else {
|
||||||
refetch();
|
refetch();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const PaymentReexportButton = ({ paymentModal, payment, refetch, setPaymentConte
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (refetch) {
|
if (refetch) {
|
||||||
if (context.refetchRequiresContext) {
|
if (paymentModal.context.refetchRequiresContext) {
|
||||||
refetch(paymentUpdateResponse && paymentUpdateResponse.data.update_payments.returning[0]);
|
refetch(paymentUpdateResponse && paymentUpdateResponse.data.update_payments.returning[0]);
|
||||||
} else {
|
} else {
|
||||||
refetch();
|
refetch();
|
||||||
|
|||||||
Reference in New Issue
Block a user