IO-256 Remove credentials with Axios calls for QBO.

This commit is contained in:
Patrick Fic
2021-10-22 10:00:23 -07:00
parent 434ed46b5a
commit 9d4a59ca16
7 changed files with 21 additions and 54 deletions

View File

@@ -9,7 +9,6 @@ import { auth, logImEXEvent } from "../../firebase/firebase.utils";
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
import { UPDATE_PAYMENTS } from "../../graphql/payments.queries";
import {
selectBodyshop,
selectCurrentUser,
@@ -33,20 +32,15 @@ export function PaymentExportButton({
const [loading, setLoading] = useState(false);
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
const handleQbxml = async () => {
logImEXEvent("accounting_payment_export");
setLoading(true);
//Check if it's a QBO Setup.
let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(
`/qbo/payments`,
{
payments: [paymentId],
},
{ withCredentials: true }
);
PartnerResponse = await axios.post(`/qbo/payments`, {
payments: [paymentId],
});
} else {
//Default is QBD