Skip to content

Commit

Permalink
remove nested promise
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Damm committed Aug 10, 2019
1 parent dc1f1e2 commit 7dab718
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions controllers/helpers/taskrouter-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@ module.exports.createTask = function (workflowSid, attributes) {
taskChannel: 'voice'
}

return new Promise((resolve, reject) => {

client.taskrouter.workspaces(process.env.TWILIO_WORKSPACE_SID).tasks.create(data)
.then(task => {
resolve(task)
}).catch(error => {
reject(error)
})

})

return client.taskrouter.workspaces(process.env.TWILIO_WORKSPACE_SID).tasks.create(data)
}

module.exports.getOngoingTasks = function (name) {
Expand Down

0 comments on commit 7dab718

Please sign in to comment.