mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
FIX: A couple of other deprecations to keep discourse-tagging
happy
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
export default (name, opts) => {
|
export default (name, opts) => {
|
||||||
opts = 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__;
|
const container = Discourse.__container__;
|
||||||
|
|
||||||
// We use the container here because modals are like singletons
|
// We use the container here because modals are like singletons
|
||||||
|
@ -18,7 +18,16 @@ const RestModel = Ember.Object.extend(Presence, {
|
|||||||
const self = this;
|
const self = this;
|
||||||
self.set('isSaving', true);
|
self.set('isSaving', true);
|
||||||
return store.update(type, this.get('id'), props).then(function(res) {
|
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);
|
self.afterUpdate(res);
|
||||||
return res;
|
return res;
|
||||||
}).finally(() => this.set('isSaving', false));
|
}).finally(() => this.set('isSaving', false));
|
||||||
|
Reference in New Issue
Block a user