mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 23:42:24 +00:00
22 lines
522 B
CoffeeScript
22 lines
522 B
CoffeeScript
Promise = require('bluebird')
|
|
canvas = require('./_canvas')
|
|
errors = require('../errors/errors')
|
|
|
|
exports.getAll = (applicationId) ->
|
|
return canvas.get
|
|
resource: 'environment_variable'
|
|
options:
|
|
filter:
|
|
application: applicationId
|
|
orderby: 'name asc'
|
|
|
|
.then (environmentVariables) ->
|
|
if not environmentVariables?
|
|
return Promise.reject(new errors.NotFound('environment variables'))
|
|
return environmentVariables
|
|
|
|
exports.remove = (id) ->
|
|
return canvas.delete
|
|
resource: 'environment_variable'
|
|
id: id
|