IO-256 Resolve QBO Aposstroph Issues

This commit is contained in:
Patrick Fic
2021-10-27 11:36:40 -07:00
parent 34e220dcad
commit 2c00e5ee79
3 changed files with 17 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
const urlBuilder = require("./qbo").urlBuilder;
const StandardizeName = require("./qbo").StandardizeName;
const path = require("path");
require("dotenv").config({
path: path.resolve(
@@ -166,7 +168,9 @@ async function QueryInsuranceCo(oauthClient, qbo_realmId, req, job) {
url: urlBuilder(
qbo_realmId,
"query",
`select * From Customer where DisplayName = '${job.ins_co_nm}'`
`select * From Customer where DisplayName = '${StandardizeName(
job.ins_co_nm
)}'`
),
method: "POST",
headers: {
@@ -228,7 +232,9 @@ async function QueryOwner(oauthClient, qbo_realmId, req, job) {
url: urlBuilder(
qbo_realmId,
"query",
`select * From Customer where DisplayName = '${ownerName}'`
`select * From Customer where DisplayName = '${StandardizeName(
ownerName
)}'`
),
method: "POST",
headers: {