FIX: A couple of other deprecations to keep `discourse-tagging` happy

This commit is contained in:
Robin Ward 2015-04-15 22:36:16 -04:00
parent a1cbd31166
commit b2f34da477
2 changed files with 15 additions and 1 deletions

View File

@ -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

View File

@ -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));