Merge pull request #34 from resin-io/fix/note-validation

Fix note command validation issues
This commit is contained in:
Juan Cruz Viotti 2015-04-29 14:43:47 -04:00
commit 361e149063
3 changed files with 12 additions and 2 deletions

View File

@ -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);
}
};

View File

@ -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)

View File

@ -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",