mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 19:16:10 +08:00
FIX: update
was not returning the responseJson
This commit is contained in:
parent
295eebddc3
commit
b973a7e83c
|
@ -220,7 +220,7 @@ export default DiscourseController.extend({
|
||||||
editReason: this.get("editReason")
|
editReason: this.get("editReason")
|
||||||
}).then(function(result) {
|
}).then(function(result) {
|
||||||
|
|
||||||
if (result.responseJson && result.responseJson.action === "enqueued") {
|
if (result.responseJson.action === "enqueued") {
|
||||||
self.send('postWasEnqueued');
|
self.send('postWasEnqueued');
|
||||||
self.destroyDraft();
|
self.destroyDraft();
|
||||||
self.close();
|
self.close();
|
||||||
|
|
|
@ -19,14 +19,14 @@ const RestModel = Ember.Object.extend(Presence, {
|
||||||
self.set('isSaving', true);
|
self.set('isSaving', true);
|
||||||
return store.update(type, this.get('id'), props).then(function(res) {
|
return store.update(type, this.get('id'), props).then(function(res) {
|
||||||
|
|
||||||
res = self.__munge(res.payload || res.responseJson);
|
const payload = self.__munge(res.payload || res.responseJson);
|
||||||
|
|
||||||
if (res.success === "OK") {
|
if (payload.success === "OK") {
|
||||||
Ember.warn("An update call should return the updated attributes");
|
Ember.warn("An update call should return the updated attributes");
|
||||||
res = props;
|
res = props;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setProperties(res);
|
self.setProperties(payload);
|
||||||
self.afterUpdate(res);
|
self.afterUpdate(res);
|
||||||
return res;
|
return res;
|
||||||
}).finally(() => this.set('isSaving', false));
|
}).finally(() => this.set('isSaving', false));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user