Skip to content
This repository has been archived by the owner on Jul 31, 2021. It is now read-only.

Commit

Permalink
fix binding creation
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbritos committed Dec 21, 2020
1 parent 88fe436 commit 8ce92a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/auth0/handlers/actionBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,28 @@ export default class ActionBindingHandler extends DefaultHandler {
async detachBinding(binding, detached) {
const params = { trigger_id: binding.trigger_id };
const existing = await this.getType();
let attachedList = [];
let atacchedList = [];
existing.forEach((existingBinding) => {
if (!existingBinding.detached) {
attachedList.push({ id: existingBinding.id });
atacchedList.push({ id: existingBinding.id });
}
});
if (!detached) {
attachedList.push({ id: binding.id });
atacchedList.push({ id: binding.id });
} else {
attachedList = attachedList.filter(id => id === binding.id);
atacchedList = atacchedList.filter(id => id === binding.id);
}
delete params.binding_id;
await this.client.actionBindings.updateList(params, {
bindings: attachedList
bindings: atacchedList
});
}

// Create Binding creates a atacched binding
async createActionBinding(data) {
const retries = 10;
const params = { trigger_id: data.trigger_id };
const actionBinding = { ...data };
const actionBinding = { action_id: data.action_id, display_name: data.display_name };
const created = await createBindingWithRetryAndTimeout(this.client, params, actionBinding, retries);

if (!created) {
Expand Down

0 comments on commit 8ce92a5

Please sign in to comment.