FIX: `Discourse.ajax` is deprecated.
This commit is contained in:
parent
fbd3727c7d
commit
5a2794a0c7
|
@ -1,5 +1,6 @@
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
import { ajax } from 'discourse/lib/ajax';
|
||||||
|
|
||||||
import { allowsImages } from 'discourse/lib/utilities';
|
import { allowsImages } from 'discourse/lib/utilities';
|
||||||
|
|
||||||
|
@ -34,8 +35,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
|
|
||||||
refreshGravatar() {
|
refreshGravatar() {
|
||||||
this.set("gravatarRefreshDisabled", true);
|
this.set("gravatarRefreshDisabled", true);
|
||||||
return Discourse
|
return ajax(`/user_avatar/${this.get("username")}/refresh_gravatar.json`, { method: "POST" })
|
||||||
.ajax(`/user_avatar/${this.get("username")}/refresh_gravatar.json`, { method: "POST" })
|
|
||||||
.then(result => this.setProperties({
|
.then(result => this.setProperties({
|
||||||
gravatar_avatar_template: result.gravatar_avatar_template,
|
gravatar_avatar_template: result.gravatar_avatar_template,
|
||||||
gravatar_avatar_upload_id: result.gravatar_upload_id,
|
gravatar_avatar_upload_id: result.gravatar_upload_id,
|
||||||
|
|
Loading…
Reference in New Issue