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
'''
permission: 'user'
action: ->
devices = resin.models.device.getSupportedDeviceTypes()
action: (params, options, done) ->
resin.models.device.getSupportedDeviceTypes (error, devices) ->
return done(error) if error?
_.each(devices, _.unary(console.log))
done()
exports.init =
signature: 'device init [device]'