conductor-node 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/qb/ClientQBD.js +4 -3
- package/package.json +1 -1
package/dist/src/qb/ClientQBD.js
CHANGED
|
@@ -11,10 +11,11 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
11
11
|
* Available APIs: https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop
|
|
12
12
|
*/
|
|
13
13
|
async sendRequest(qbwcUsername, requestObj) {
|
|
14
|
+
const apiServerURL = `${this.serverURL}/qbd`;
|
|
14
15
|
if (this.verbose) {
|
|
15
|
-
console.log(`Client sent request to ${
|
|
16
|
+
console.log(`Client sent request to ${apiServerURL} for user ${qbwcUsername}:`, JSON.stringify(requestObj, null, 2));
|
|
16
17
|
}
|
|
17
|
-
const response = await fetch(
|
|
18
|
+
const response = await fetch(apiServerURL, {
|
|
18
19
|
body: JSON.stringify({ qbwcUsername, requestObj }),
|
|
19
20
|
headers: {
|
|
20
21
|
"Content-Type": "application/json",
|
|
@@ -23,7 +24,7 @@ class ClientQBD extends BaseClient_1.default {
|
|
|
23
24
|
method: "POST",
|
|
24
25
|
});
|
|
25
26
|
if (response.status >= 400) {
|
|
26
|
-
throw new Error(`Request to ${
|
|
27
|
+
throw new Error(`Request to ${apiServerURL} failed with status ${response.status}: ${response.statusText}`);
|
|
27
28
|
}
|
|
28
29
|
const responseObj = (await response.json());
|
|
29
30
|
if (this.verbose) {
|