Verified Commit 73f9ad56 authored by Löscher Mario's avatar Löscher Mario
Browse files

fixed too many decimals, fixed double constraint for part2 (resulting in

an error reported by js, but working as expected)
parent 1cac412c
......@@ -26,10 +26,10 @@ temperature.controller('MainController', function ($scope, $route, $routeParams,
current.producer = tmp[1].split(":")[1];
current.timestamp = tmp[2].split(":")[1];
current.value = tmp[3].split(":")[1];
current.value = parseInt(current.value * 1000) / 1000;
current.consumer = tmp[4].split(":")[1].slice(0,1);
$scope.points.list.push(current);
}
countOccurrences();
};
//As I found no working way for the aggregate and join function for couchdb, removing manually here
......@@ -73,7 +73,6 @@ temperature.controller('MainController', function ($scope, $route, $routeParams,
let executeSearch =function (data) {
$http.post("https://distributed.mein-server.at/api/rest.php/find", data).then(
function (response) {
console.log(response);
arrayIFyCouchJson(response);
})
};
......@@ -131,7 +130,8 @@ temperature.controller('MainController', function ($scope, $route, $routeParams,
"sort": ["value"],
// "aggregator": {"operation": "count", "of": ["value"], "group": ["value"]}
});
executeSearch(data);
executeSearch(data)
.then(countOccurrences);
};
//Creates the index for value and timestamp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment