Send device type correctly to getManifestBySlug

Currently, we we're sending the wholea device object to
`getManifestBySlug`, which ended up in an unsupported device error.
This commit is contained in:
Juan Cruz Viotti 2015-09-30 11:38:34 -04:00
parent 5ae83d8337
commit 79d1892b66
2 changed files with 2 additions and 1 deletions

View File

@ -104,7 +104,7 @@
permission: 'user',
action: function(params, options, done) {
console.info('Initializing device');
return resin.models.device.get(params.uuid).then(resin.models.device.getManifestBySlug).then(function(manifest) {
return resin.models.device.get(params.uuid).get('device_type').then(resin.models.device.getManifestBySlug).then(function(manifest) {
var ref;
return (ref = manifest.initialization) != null ? ref.options : void 0;
}).then(form.run).tap(function(answers) {

View File

@ -108,6 +108,7 @@ exports.initialize =
action: (params, options, done) ->
console.info('Initializing device')
resin.models.device.get(params.uuid)
.get('device_type')
.then(resin.models.device.getManifestBySlug)
.then (manifest) ->
return manifest.initialization?.options