@go-avro/avro-js 0.0.2-beta.20 → 0.0.2-beta.22
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/client/QueryClient.js +9 -15
- package/package.json +1 -1
|
@@ -28,8 +28,8 @@ export class AvroQueryClient {
|
|
|
28
28
|
}
|
|
29
29
|
return null;
|
|
30
30
|
};
|
|
31
|
-
return
|
|
32
|
-
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
this.config.authManager.accessToken().then(token => {
|
|
33
33
|
const cancelErr = checkCancelled();
|
|
34
34
|
if (cancelErr)
|
|
35
35
|
return reject(cancelErr);
|
|
@@ -297,8 +297,7 @@ export class AvroQueryClient {
|
|
|
297
297
|
return this._xhr('POST', `/email/${emailId}`, formData);
|
|
298
298
|
}
|
|
299
299
|
catch (error) {
|
|
300
|
-
|
|
301
|
-
throw error;
|
|
300
|
+
throw new StandardError(500, `Failed to send email: ${error}`);
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
createBill(companyGuid, data) {
|
|
@@ -313,16 +312,11 @@ export class AvroQueryClient {
|
|
|
313
312
|
users: data.users,
|
|
314
313
|
due_date: data.due_date,
|
|
315
314
|
};
|
|
316
|
-
|
|
317
|
-
.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
})
|
|
323
|
-
.catch(err => {
|
|
324
|
-
console.error('Failed to create bill:', err);
|
|
325
|
-
throw new StandardError(500, 'Failed to create bill');
|
|
326
|
-
});
|
|
315
|
+
try {
|
|
316
|
+
return this._xhr('POST', `/company/${companyGuid}/bill`, body);
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
throw new StandardError(500, `Failed to create bill: ${error}`);
|
|
320
|
+
}
|
|
327
321
|
}
|
|
328
322
|
}
|