Move device display name logic to application model

This commit is contained in:
Juan Cruz Viotti 2015-01-06 13:24:11 -03:00
parent c311738dd1
commit be2b556d91
2 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,7 @@ exports.info = permissions.user (params) ->
errors.handle(error) if error?
log.out ui.widgets.table.vertical application, (application) ->
application.device_type = resin.models.device.getDisplayName(application.device_type)
application.device_type = application.device_display_name
return application
, [ 'ID', 'Name', 'Device Type', 'Git Repository', 'Commit' ]

View File

@ -60,6 +60,8 @@ exports.get = (id, callback) ->
if not application?
return callback(new errors.NotFound("application #{id}"))
application.device_display_name = deviceModel.getDisplayName(application.device_type)
return callback(null, application)
.catch (error) ->