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