balena-cli/lib/models/application.coffee
2014-11-21 09:43:03 -04:00

26 lines
455 B
CoffeeScript

Promise = require('bluebird')
canvas = require('./_canvas')
exports.getAll = ->
return canvas.get
resource: 'application'
options:
orderby: 'app_name asc'
expand: 'device'
exports.get = (id) ->
return canvas.get
resource: 'application'
id: id
.then (application) ->
if not application?
Promise.reject(new Error('Not found'))
return application
exports.remove = (id) ->
return canvas.delete
resource: 'application'
id: id