FIX: A couple of other deprecations to keep `discourse-tagging` happy
This commit is contained in:
parent
a1cbd31166
commit
b2f34da477
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue