|
|
|
@ -28,10 +28,13 @@ function onRequest(context) {
|
|
|
|
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
|
|
|
|
var device = deviceModule.viewDevice(deviceType, deviceId);
|
|
|
|
|
if (device && device.status != "error") {
|
|
|
|
|
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}};
|
|
|
|
|
return {
|
|
|
|
|
"device": device.content,
|
|
|
|
|
"autoCompleteParams": autoCompleteParams,
|
|
|
|
|
"encodedFeaturePayloads": ""
|
|
|
|
|
"encodedFeaturePayloads": "",
|
|
|
|
|
"portalUrl" : devicemgtProps['portalURL'],
|
|
|
|
|
"anchor" : JSON.stringify(anchor)
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
|
|
|
|