Make use of resin.models.device.getSupportedDeviceTypes() asynchronously

This commit is contained in:
Juan Cruz Viotti 2015-02-11 09:53:48 -04:00
parent 65729012b6
commit a6a3eeae6d

View File

@ -134,9 +134,11 @@ exports.supported =
$ resin devices supported $ resin devices supported
''' '''
permission: 'user' permission: 'user'
action: -> action: (params, options, done) ->
devices = resin.models.device.getSupportedDeviceTypes() resin.models.device.getSupportedDeviceTypes (error, devices) ->
_.each(devices, _.unary(console.log)) return done(error) if error?
_.each(devices, _.unary(console.log))
done()
exports.init = exports.init =
signature: 'device init [device]' signature: 'device init [device]'