From d29d63a9159170846cf50fcc049c82178ebc36b9 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 7 Aug 2015 15:04:14 +0530 Subject: [PATCH] few changes --- .../jaggeryapps/iotserver/api/event-api.jag | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/api/event-api.jag b/modules/distribution/src/repository/jaggeryapps/iotserver/api/event-api.jag index 944722c1..18b6e53f 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/api/event-api.jag +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/api/event-api.jag @@ -48,6 +48,26 @@ if (uriMatcher.match("/{context}/api/event/list")) { } catch (error) { log.error(error); } + + var eventsData = []; + + if (fetchedData == null) return []; + + for (var i = 0; i < fetchedData.size(); i++) { + //eventsData.push({ + // time: fetchedData.get(i).getTime(), + // deviceName: fetchedData.get(i).getDeviceName(), + // activity: fetchedData.get(i).getDeviceActivity() + //}); + + eventsData.push({ + time: 234234, + deviceName: "my device", + activity: "test" + }); + } + + return eventsData; } // returning the result.