This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/not-activated.js.es6
2017-03-30 10:23:24 -04:00

25 lines
628 B
JavaScript

import { ajax } from 'discourse/lib/ajax';
import { popupAjaxError } from 'discourse/lib/ajax-error';
import ModalFunctionality from 'discourse/mixins/modal-functionality';
import { userPath } from 'discourse/lib/url';
export default Ember.Controller.extend(ModalFunctionality, {
emailSent: false,
onShow() {
this.set("emailSent", false);
},
actions: {
sendActivationEmail() {
ajax(userPath('action/send_activation_email'), {
data: { username: this.get('username') },
type: 'POST'
}).then(() => {
this.set('emailSent', true);
}).catch(popupAjaxError);
}
}
});