Skip to content

Commit

Permalink
fix: Fix updating webhook triggers (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsocha2 authored Mar 25, 2022
1 parent 74c4922 commit 09e94c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/box-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ class BoxCommand extends Command {
let asUser = bulkData.find((o) => o.fieldKey === 'as-user') || {};
if (!_.isEmpty(asUser)) {
if (_.isNil(asUser.value)) {
let environmentsObj = await this.getEnvironments();
let environmentsObj = await this.getEnvironments(); // eslint-disable-line no-await-in-loop
if (environmentsObj.default) {
let environment =
environmentsObj.environments[environmentsObj.default];
Expand Down
2 changes: 1 addition & 1 deletion src/commands/webhooks/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class WebhooksUpdateCommand extends BoxCommand {
let updates = {};

if (flags.triggers) {
updates.trigger = flags.triggers.split(',');
updates.triggers = flags.triggers.split(',');
}
if (flags.address) {
updates.address = flags.address;
Expand Down
4 changes: 2 additions & 2 deletions test/commands/webhooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('Webhooks', () => {

test
.nock(TEST_API_ROOT, api => api
.put(`/2.0/webhooks/${webhookId}`, { trigger: triggers.split(',') })
.put(`/2.0/webhooks/${webhookId}`, { triggers: triggers.split(',') })
.reply(200, fixture)
)
.stdout()
Expand All @@ -199,7 +199,7 @@ describe('Webhooks', () => {

test
.nock(TEST_API_ROOT, api => api
.put(`/2.0/webhooks/${webhookId}`, { trigger: triggers.split(',') })
.put(`/2.0/webhooks/${webhookId}`, { triggers: triggers.split(',') })
.reply(200, fixture)
)
.stdout()
Expand Down

0 comments on commit 09e94c3

Please sign in to comment.