diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js index e9c68c6452..62ca011b0b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js @@ -27,12 +27,12 @@ function onRequest(context) { var utility = require("/app/modules/utility.js").utility; var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { - var deviceTypes = typesListResponse["content"]; + var deviceTypes = typesListResponse.content.deviceTypes; if (deviceTypes) { var deviceTypesList = [], virtualDeviceTypesList = []; for (var i = 0; i < deviceTypes.length; i++) { - - var deviceTypeLabel = deviceTypes[i].name; + var deviceType = deviceTypes[i]; + var deviceTypeLabel = deviceType; var configs = utility.getDeviceTypeConfig(deviceTypeLabel); var deviceCategory = "device"; if (configs) { @@ -45,22 +45,20 @@ function onRequest(context) { } if (deviceCategory == 'virtual') { virtualDeviceTypesList.push({ - "hasCustTemplate": false, - "deviceTypeLabel": deviceTypeLabel, - "deviceTypeName": deviceTypes[i].name, - "deviceCategory": deviceCategory, - "deviceTypeId": deviceTypes[i].id, - "thumb": utility.getDeviceThumb(deviceTypes[i].name) - }); + "hasCustTemplate": false, + "deviceTypeLabel": deviceTypeLabel, + "deviceTypeName": deviceType, + "deviceCategory": deviceCategory, + "thumb": utility.getDeviceThumb(deviceType) + }); } else { deviceTypesList.push({ - "hasCustTemplate": false, - "deviceTypeLabel": deviceTypeLabel, - "deviceTypeName": deviceTypes[i].name, - "deviceCategory": deviceCategory, - "deviceTypeId": deviceTypes[i].id, - "thumb": utility.getDeviceThumb(deviceTypes[i].name) - }); + "hasCustTemplate": false, + "deviceTypeLabel": deviceTypeLabel, + "deviceTypeName": deviceType, + "deviceCategory": deviceCategory, + "thumb": utility.getDeviceThumb(deviceType) + }); } } if (virtualDeviceTypesList.length > 0) {