Skip to content

Commit 1235217

Browse files
Merge pull request #467 from marisuch/master
Fix for endpoint account/{accountId}/account-services/{id}/billing-pe…
2 parents fe04a72 + 6f00970 commit 1235217

8 files changed

+49
-101
lines changed

dist/bitbar-cloud-api-client.js

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 39 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitbar/cloud-api-client",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "Bitbar Cloud API Client for JavaScript",
55
"main": "dist/bitbar-cloud-api-client.min.js",
66
"types": "dist/index.d.ts",

src/api/APIResourceAccount.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('APIResourceAccount', () => {
125125
it('should initialize proper endpoint path', () => {
126126
const call = service.serviceBillingPeriod(1);
127127
expect(call).toBeInstanceOf(APIResource);
128-
expect(call.toUrl()).toEqual(`${baseUrl}-services/1/billing-period`);
128+
expect(call.toUrl()).toEqual(`${baseUrl}/account-services/1/billing-period`);
129129
});
130130

131131
it('should throw error if resource ID is nulll', () => {

src/api/APIResourceAccount.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ export class APIResourceAccount extends APIResource<Account> {
8989
throw new Error('Resource ID cannot be null!');
9090
}
9191

92-
const billingPeriod = new APIResource<AccountServicePayment, BillingPeriodQueryParams, NoData>(this);
93-
billingPeriod.last += '-services';
94-
billingPeriod.push(id, 'billing-period');
95-
return billingPeriod;
92+
return new APIResource<AccountServicePayment, BillingPeriodQueryParams, NoData>(this).push('account-services', id, 'billing-period');
9693
}
9794

9895
}

0 commit comments

Comments
 (0)