|
|
@ -28,10 +28,13 @@ 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") {
|
|
|
|
|
|
|
|
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}};
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"device": device.content,
|
|
|
|
"device": device.content,
|
|
|
|
"autoCompleteParams": autoCompleteParams,
|
|
|
|
"autoCompleteParams": autoCompleteParams,
|
|
|
|
"encodedFeaturePayloads": ""
|
|
|
|
"encodedFeaturePayloads": "",
|
|
|
|
|
|
|
|
"portalUrl" : devicemgtProps['portalURL'],
|
|
|
|
|
|
|
|
"anchor" : JSON.stringify(anchor)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} 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!");
|
|
|
|