diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index 5afe148ffa8..7a97eda7a91 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -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(); diff --git a/app/assets/javascripts/discourse/models/rest.js.es6 b/app/assets/javascripts/discourse/models/rest.js.es6 index a2b8bf676d3..843e22eb1b9 100644 --- a/app/assets/javascripts/discourse/models/rest.js.es6 +++ b/app/assets/javascripts/discourse/models/rest.js.es6 @@ -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));