mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:28:59 +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")
|
||||
}).then(function(result) {
|
||||
|
||||
if (result.responseJson && result.responseJson.action === "enqueued") {
|
||||
if (result.responseJson.action === "enqueued") {
|
||||
self.send('postWasEnqueued');
|
||||
self.destroyDraft();
|
||||
self.close();
|
||||
|
|
|
@ -19,14 +19,14 @@ const RestModel = Ember.Object.extend(Presence, {
|
|||
self.set('isSaving', true);
|
||||
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");
|
||||
res = props;
|
||||
}
|
||||
|
||||
self.setProperties(res);
|
||||
self.setProperties(payload);
|
||||
self.afterUpdate(res);
|
||||
return res;
|
||||
}).finally(() => this.set('isSaving', false));
|
||||
|
|
Loading…
Reference in New Issue
Block a user