mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +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)
|
this.hass.callApi(this.method, this.path, this.data)
|
||||||
.then(function () {
|
.then(function (resp) {
|
||||||
el.progress = false;
|
el.progress = false;
|
||||||
el.$.progress.actionSuccess();
|
el.$.progress.actionSuccess();
|
||||||
eventData.success = true;
|
eventData.success = true;
|
||||||
}, function () {
|
eventData.response = resp;
|
||||||
|
}, function (resp) {
|
||||||
el.progress = false;
|
el.progress = false;
|
||||||
el.$.progress.actionError();
|
el.$.progress.actionError();
|
||||||
eventData.success = false;
|
eventData.success = false;
|
||||||
|
eventData.response = resp;
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
el.fire('hass-api-called', eventData);
|
el.fire('hass-api-called', eventData);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user