mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Include response in api call response
This commit is contained in:
parent
95b2fa0ad3
commit
1f6f2c9260
@ -56,14 +56,16 @@ Polymer({
|
||||
};
|
||||
|
||||
this.hass.callApi(this.method, this.path, this.data)
|
||||
.then(function () {
|
||||
.then(function (resp) {
|
||||
el.progress = false;
|
||||
el.$.progress.actionSuccess();
|
||||
eventData.success = true;
|
||||
}, function () {
|
||||
eventData.response = resp;
|
||||
}, function (resp) {
|
||||
el.progress = false;
|
||||
el.$.progress.actionError();
|
||||
eventData.success = false;
|
||||
eventData.response = resp;
|
||||
}).then(function () {
|
||||
el.fire('hass-api-called', eventData);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user