Fix error log resolve
logging/entry/<entryId>/attr/Resolved is a boolean as such
send true when resolving.
Before the function was always returning successful, fixed this
and log to the console when it fails.
Tested: Resolved multiple error logs and see the fail in the
console on a fail.
Change-Id: I60496f30f9241ffb6b6b73cf87b7481bea10b24f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/directives/log-event.js b/app/common/directives/log-event.js
index cf8c41b..e179389 100644
--- a/app/common/directives/log-event.js
+++ b/app/common/directives/log-event.js
@@ -22,11 +22,16 @@
console.error('Error!', err);
};
$scope.resolveEvent = function(event) {
- APIUtils.resolveLogs([{Id: event.Id}]).then(function() {
- event.Resolved = 1;
- });
+ APIUtils.resolveLogs([{Id: event.Id}])
+ .then(
+ function(data) {
+ event.Resolved = 1;
+ },
+ function(error) {
+ // TODO: Show error to user
+ console.log(JSON.stringify(error));
+ });
};
-
$scope.accept = function() {
$scope.event.selected = true;
$timeout(function() {