mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-21 11:35:54 +00:00
Throw a nice error if note contents are missing
This commit is contained in:
parent
faecf103bf
commit
fab85b381a
@ -1,5 +1,7 @@
|
||||
(function() {
|
||||
var async, resin;
|
||||
var _, async, resin;
|
||||
|
||||
_ = require('lodash');
|
||||
|
||||
async = require('async');
|
||||
|
||||
@ -20,6 +22,9 @@
|
||||
],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
if (_.isEmpty(params.note)) {
|
||||
return done(new Error('Missing note content'));
|
||||
}
|
||||
return resin.models.device.note(options.device, params.note, done);
|
||||
}
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
_ = require('lodash')
|
||||
async = require('async')
|
||||
resin = require('resin-sdk')
|
||||
|
||||
@ -25,4 +26,8 @@ exports.set =
|
||||
]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
|
||||
if _.isEmpty(params.note)
|
||||
return done(new Error('Missing note content'))
|
||||
|
||||
resin.models.device.note(options.device, params.note, done)
|
||||
|
Loading…
x
Reference in New Issue
Block a user