Fixing invalid device object returned

revert-dabc3590
Rasika Perera 8 years ago
parent 0d07295623
commit 177f77bde4

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

Loading…
Cancel
Save