FEATURE: optimize invite js code
This commit is contained in:
parent
566cf31c66
commit
4fb9269642
|
@ -88,12 +88,11 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
|
||||
rescindAll() {
|
||||
const self = this;
|
||||
bootbox.confirm(I18n.t("user.invited.rescind_all_confirm"), confirm => {
|
||||
if (confirm) {
|
||||
Invite.rescindAll().then(function() {
|
||||
self.set('rescindedAll', true);
|
||||
self.get('model.invites').clear();
|
||||
Invite.rescindAll().then(() => {
|
||||
this.set('rescindedAll', true);
|
||||
this.get('model.invites').clear();
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
});
|
||||
|
@ -105,11 +104,10 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
|
||||
reinviteAll() {
|
||||
const self = this;
|
||||
bootbox.confirm(I18n.t("user.invited.reinvite_all_confirm"), confirm => {
|
||||
if (confirm) {
|
||||
Invite.reinviteAll().then(function() {
|
||||
self.set('reinvitedAll', true);
|
||||
Invite.reinviteAll().then(() => {
|
||||
this.set('reinvitedAll', true);
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue