IO-256 Exporting of payments

This commit is contained in:
Patrick Fic
2021-10-12 19:07:43 -07:00
parent fff9073f9d
commit 4d52a5c44a
10 changed files with 415 additions and 94 deletions

View File

@@ -78,7 +78,8 @@ exports.default = async (req, res) => {
ret.push({
billid: bill.id,
success: false,
errorMessage: error.message,
errorMessage:
(error && error.authResponse.body) || JSON.stringify(error),
});
}
}
@@ -113,7 +114,7 @@ async function QueryVendorRecord(oauthClient, req, bill) {
);
} catch (error) {
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
error: JSON.stringify(error),
error: (error && error.authResponse.body) || JSON.stringify(error),
method: "QueryVendorRecord",
});
throw error;
@@ -136,7 +137,7 @@ async function InsertVendorRecord(oauthClient, req, bill) {
return result && result.Vendor;
} catch (error) {
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
error: JSON.stringify(error),
error: (error && error.authResponse.body) || JSON.stringify(error),
method: "InsertVendorRecord",
});
throw error;
@@ -185,7 +186,7 @@ async function InsertBill(oauthClient, req, bill, vendor) {
return result && result.Bill;
} catch (error) {
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
error: JSON.stringify(error),
error: (error && error.authResponse.body) || JSON.stringify(error),
method: "InsertBill",
});
throw error;