Merge branch 'release/2024-03-28' into test-AIO
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import { Button, notification } from "antd";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { connect } from "react-redux";
|
||||
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser
|
||||
@@ -37,7 +37,6 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const paymentUpdateResponse = await updatePayment({
|
||||
variables: {
|
||||
paymentId: payment.id,
|
||||
@@ -46,16 +45,12 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!!!paymentUpdateResponse.errors) {
|
||||
notification.open({
|
||||
type: "success",
|
||||
key: "paymentsuccessmarkforexport",
|
||||
message: t("payments.successes.markexported")
|
||||
});
|
||||
|
||||
if (refetch) refetch();
|
||||
|
||||
setPaymentContext({
|
||||
actions: {
|
||||
refetch
|
||||
@@ -65,6 +60,12 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont
|
||||
exportedat: today
|
||||
}
|
||||
});
|
||||
|
||||
if (refetch)
|
||||
refetch(
|
||||
paymentUpdateResponse &&
|
||||
paymentUpdateResponse.data.update_payments.returning[0]
|
||||
);
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("payments.errors.exporting", {
|
||||
|
||||
Reference in New Issue
Block a user