balena-cli/lib/models/application.coffee

21 lines
372 B
CoffeeScript
Raw Normal View History

2014-11-19 13:23:40 +00:00
Promise = require('bluebird')
canvas = require('./_canvas')
exports.getAll = ->
return canvas.get
resource: 'application'
options:
orderby: 'app_name asc'
expand: 'device'
2014-11-19 13:23:40 +00:00
exports.get = (id) ->
return canvas.get
resource: 'application'
id: id
.then (application) ->
if not application?
Promise.reject(new Error('Not found'))
return application