Lint all the things
This commit is contained in:
@@ -2,7 +2,7 @@ import { useMutation } from "@apollo/client";
|
||||
import { Button } from "antd";
|
||||
import axios from "axios";
|
||||
import _ from "lodash";
|
||||
import React, { useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -35,8 +35,7 @@ export function PaymentsExportAllButton({
|
||||
paymentIds,
|
||||
disabled,
|
||||
loadingCallback,
|
||||
completedCallback,
|
||||
refetch
|
||||
completedCallback
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [updatePayments] = useMutation(UPDATE_PAYMENTS);
|
||||
@@ -48,7 +47,7 @@ export function PaymentsExportAllButton({
|
||||
setLoading(true);
|
||||
if (loadingCallback) loadingCallback(true);
|
||||
let PartnerResponse;
|
||||
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
|
||||
if (bodyshop.accountingconfig?.qbo) {
|
||||
PartnerResponse = await axios.post(`/qbo/payments`, {
|
||||
payments: paymentIds,
|
||||
elgen: true
|
||||
@@ -100,7 +99,7 @@ export function PaymentsExportAllButton({
|
||||
})
|
||||
})
|
||||
);
|
||||
if (!(bodyshop.accountingconfig && bodyshop.accountingconfig.qbo)) {
|
||||
if (!bodyshop.accountingconfig?.qbo) {
|
||||
//QBO Logs are handled server side.
|
||||
await insertExportLog({
|
||||
variables: {
|
||||
@@ -117,7 +116,7 @@ export function PaymentsExportAllButton({
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (!(bodyshop.accountingconfig && bodyshop.accountingconfig.qbo)) {
|
||||
if (!bodyshop.accountingconfig?.qbo) {
|
||||
//QBO Logs are handled server side.
|
||||
|
||||
await insertExportLog({
|
||||
@@ -135,7 +134,7 @@ export function PaymentsExportAllButton({
|
||||
const paymentUpdateResponse = await updatePayments({
|
||||
variables: {
|
||||
paymentIdList: successfulTransactions.map(
|
||||
(st) => st[bodyshop.accountingconfig && bodyshop.accountingconfig.qbo ? "paymentid" : "id"]
|
||||
(st) => st[bodyshop.accountingconfig?.qbo ? "paymentid" : "id"]
|
||||
),
|
||||
payment: {
|
||||
exportedat: new Date()
|
||||
@@ -164,11 +163,7 @@ export function PaymentsExportAllButton({
|
||||
message: t("payments.successes.exported")
|
||||
});
|
||||
updatePaymentCache([
|
||||
...new Set(
|
||||
successfulTransactions.map(
|
||||
(st) => st[bodyshop.accountingconfig && bodyshop.accountingconfig.qbo ? "paymentid" : "id"]
|
||||
)
|
||||
)
|
||||
...new Set(successfulTransactions.map((st) => st[bodyshop.accountingconfig?.qbo ? "paymentid" : "id"]))
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user