From b2f34da4772841f4835a80fa5ef64c7a63463784 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 15 Apr 2015 22:36:16 -0400 Subject: [PATCH] FIX: A couple of other deprecations to keep `discourse-tagging` happy --- .../javascripts/discourse/lib/show-modal.js.es6 | 5 +++++ app/assets/javascripts/discourse/models/rest.js.es6 | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/show-modal.js.es6 b/app/assets/javascripts/discourse/lib/show-modal.js.es6 index 91713ca7076..01cc0240213 100644 --- a/app/assets/javascripts/discourse/lib/show-modal.js.es6 +++ b/app/assets/javascripts/discourse/lib/show-modal.js.es6 @@ -1,6 +1,11 @@ export default (name, opts) => { opts = opts || {}; + if (opts.__type) { + Ember.warn("showModal now takes `opts` as a second param instead of a model"); + opts = {model: opts}; + } + const container = Discourse.__container__; // We use the container here because modals are like singletons diff --git a/app/assets/javascripts/discourse/models/rest.js.es6 b/app/assets/javascripts/discourse/models/rest.js.es6 index 8bb5d0250f3..de4d756d792 100644 --- a/app/assets/javascripts/discourse/models/rest.js.es6 +++ b/app/assets/javascripts/discourse/models/rest.js.es6 @@ -18,7 +18,16 @@ const RestModel = Ember.Object.extend(Presence, { const self = this; self.set('isSaving', true); return store.update(type, this.get('id'), props).then(function(res) { - self.setProperties(self.__munge(res.payload || res.responseJson)); + + res = self.__munge(res.payload || res.responseJson); + + console.log(res); + if (res.success === "OK") { + Ember.warn("An update call should return the updated attributes"); + res = props; + } + + self.setProperties(res); self.afterUpdate(res); return res; }).finally(() => this.set('isSaving', false));