Add toast to LED page
Toast error notification alerts user if LED light switch was
not successful.
Change-Id: I4f7af80276b6fefa93c8d0f0f50f8b28a06bced3
Signed-off-by: beccabroek <beccabroek@gmail.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 9e458aa..0de6b1f 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -838,29 +838,14 @@
});
return deferred.promise;
},
- setLEDState: function(state, callback) {
- $http({
+ setLEDState: function(state) {
+ return $http({
method: 'PUT',
url: DataService.getHost() +
'/xyz/openbmc_project/led/groups/enclosure_identify/attr/Asserted',
withCredentials: true,
data: JSON.stringify({'data': state})
})
- .then(
- function(response) {
- var json = JSON.stringify(response.data);
- var content = JSON.parse(json);
- if (callback) {
- return callback(content.status);
- }
- },
- function(error) {
- if (callback) {
- callback(error);
- } else {
- console.log(error);
- }
- });
},
bmcReboot: function(callback) {
$http({