@wmfs/tymly-cardscript-plugin
Version:
Plugin which handles interactions to do with Cardscript
16 lines (12 loc) • 372 B
JavaScript
class RemoveTodoEntries {
init (resourceConfig, env) {
this.todos = env.bootedServices.storage.models.tymly_todos
}
run (event, context) {
this.todos.destroyById(event.todoId)
.then(context.sendTaskSuccess())
.catch(err => context.sendTaskFailure({ error: 'removeTodoFail', cause: err }))
}
}
module.exports = RemoveTodoEntries