Prevented unnecessary API calls to fetch device-info if the device is disenrolled which resolves wso2/product-iots#429

revert-dabc3590
Harshan Liyanage 8 years ago
parent 428fabd043
commit dbfdb0d084

@ -9,7 +9,7 @@
<h1 class="page-sub-title device-id device-select"
data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}"
data-ownership="{{device.ownership}}"
data-owner="{{device.owner}}">
data-owner="{{device.owner}}" data-status="{{device.status}}">
Device {{device.name}}
{{#if device.model}}
<span class="lbl-device">

@ -23,6 +23,7 @@ var InitiateViewOption = null;
var deviceIdentifier = deviceId.data("deviceid");
var deviceType = deviceId.data("type");
var ownership = deviceId.data("ownership");
var devStatus = deviceId.data("status");
var payload = [deviceIdentifier];
var operationTable;
var serviceUrl;
@ -35,7 +36,7 @@ var InitiateViewOption = null;
serviceUrl = "/api/device-mgt/android/v1.0/admin/devices/info";
serviceUrlLocal = "/api/device-mgt/android/v1.0/admin/devices/location";
}
if (serviceUrl) {
if (serviceUrl && ("REMOVED" !== devStatus)) {
invokerUtil.post(
serviceUrl,
payload,

@ -10,7 +10,7 @@
<h1 class="page-sub-title device-id device-select"
data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}"
data-ownership="{{device.ownership}}"
data-owner="{{device.owner}}">
data-owner="{{device.owner}}" data-status="{{device.status}}">
Device {{device.name}}
{{#if device.model}}
<span class="lbl-device">

@ -23,6 +23,7 @@ var InitiateViewOption = null;
var deviceIdentifier = deviceId.data("deviceid");
var deviceType = deviceId.data("type");
var ownership = deviceId.data("ownership");
var devStatus = deviceId.data("status");
var payload = [deviceIdentifier];
var operationTable;
var serviceUrl;
@ -34,7 +35,7 @@ var InitiateViewOption = null;
serviceUrl = "/api/device-mgt/android/v1.0/admin/devices/info";
}
if (serviceUrl) {
if (serviceUrl && ("REMOVED" !== devStatus)) {
invokerUtil.post(
serviceUrl,
payload,

Loading…
Cancel
Save