Fix lodash bugs in device move & quickstart

Change-Type: patch
This commit is contained in:
Tim Perry 2017-08-23 14:31:18 +02:00
parent 8980bc704a
commit 492e35e5c2
4 changed files with 4 additions and 4 deletions

View File

@ -249,7 +249,7 @@ exports.move = {
patterns = require('../utils/patterns');
return resin.models.device.get(params.uuid).then(function(device) {
return options.application || patterns.selectApplication(function(application) {
return _.all([application.device_type === device.device_type, device.application_name !== application.app_name]);
return _.every([application.device_type === device.device_type, device.application_name !== application.app_name]);
});
}).tap(function(application) {
return resin.models.device.move(params.uuid, application);

View File

@ -24,7 +24,7 @@ exports.getGroupDefaults = function(group) {
_ = require('lodash');
return _.chain(group).get('options').map(function(question) {
return [question.name, question["default"]];
}).object().value();
}).fromPairs().value();
};
exports.stateToString = function(state) {

View File

@ -343,7 +343,7 @@ exports.move =
resin.models.device.get(params.uuid).then (device) ->
return options.application or patterns.selectApplication (application) ->
return _.all [
return _.every [
application.device_type is device.device_type
device.application_name isnt application.app_name
]

View File

@ -23,7 +23,7 @@ exports.getGroupDefaults = (group) ->
.get('options')
.map (question) ->
return [ question.name, question.default ]
.object()
.fromPairs()
.value()
exports.stateToString = (state) ->