Skip to content

Commit

Permalink
Merge pull request #25 from marverix/master
Browse files Browse the repository at this point in the history
Fix chaining after delete method
  • Loading branch information
snieguu authored Sep 29, 2020
2 parents 0beaf07 + e27422e commit 82ac79b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
22 changes: 17 additions & 5 deletions dist/cloud-api-client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bitbar Cloud API Client for JavaScript v0.20.0 | (c) Bitbar Technologies and contributors | https://github.com/bitbar/cloud-api-client-js/blob/master/LICENSE.md */
/* Bitbar Cloud API Client for JavaScript v0.21.1 | (c) Bitbar Technologies and contributors | https://github.com/bitbar/cloud-api-client-js/blob/master/LICENSE.md */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@bitbar/finka'), require('axios'), require('qs')) :
typeof define === 'function' && define.amd ? define(['@bitbar/finka', 'axios', 'qs'], factory) :
Expand All @@ -11,7 +11,7 @@

finka();

var version = "0.20.0";
var version = "0.21.1";

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -403,7 +403,7 @@
return _super !== null && _super.apply(this, arguments) || this;
}
APIResource.prototype.delete = function () {
this.method('DELETE');
return this.method('DELETE');
};
return APIResource;
}(APIEntity));
Expand Down Expand Up @@ -474,11 +474,20 @@

var APIResourceAccount = (function (_super) {
__extends(APIResourceAccount, _super);
function APIResourceAccount(parent) {
function APIResourceAccount(parent, id) {
var _this = _super.call(this, parent) || this;
_this.push('account');
if (id)
_this.push('accounts', id);
else
_this.push('account');
return _this;
}
APIResourceAccount.prototype.preferences = function () {
return new APIResource(this).push('preferences');
};
APIResourceAccount.prototype.concurrencyStatus = function () {
return new APIResource(this).push('concurrency-status');
};
APIResourceAccount.prototype.roles = function () {
return new APIList(this).push('roles');
};
Expand Down Expand Up @@ -1474,6 +1483,9 @@
API.prototype.accessGroup = function (id) {
return new APIResourceAccessGroup(this, id);
};
API.prototype.account = function (id) {
return new APIResourceAccount(this, id);
};
return API;
}());

Expand Down
4 changes: 2 additions & 2 deletions dist/cloud-api-client.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitbar/cloud-api-client",
"version": "0.21.0",
"version": "0.21.1",
"description": "Bitbar Cloud API Client for JavaScript",
"main": "dist/cloud-api-client.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/api/APIResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class APIResource extends APIEntity {
* @returns this
*/
public delete () {
this.method('DELETE');
return this.method('DELETE');
}
}

Expand Down

0 comments on commit 82ac79b

Please sign in to comment.