mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 18:56:25 +00:00
Merge pull request #34 from resin-io/fix/note-validation
Fix note command validation issues
This commit is contained in:
commit
361e149063
@ -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)
|
||||
|
@ -63,7 +63,7 @@
|
||||
"president": "^1.0.0",
|
||||
"progress-stream": "^0.5.0",
|
||||
"resin-cli-visuals": "^0.1.0",
|
||||
"resin-sdk": "^1.3.3",
|
||||
"resin-sdk": "^1.3.4",
|
||||
"resin-settings-client": "^1.0.0",
|
||||
"resin-vcs": "^1.2.0",
|
||||
"tmp": "^0.0.25",
|
||||
|
Loading…
Reference in New Issue
Block a user