FIX: refresh invite list after sending invite manually
This commit is contained in:
parent
1713fd4b59
commit
2451779011
|
@ -8,6 +8,7 @@
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
|
export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
|
||||||
|
needs: ['user-invited'],
|
||||||
|
|
||||||
isAdmin: function(){
|
isAdmin: function(){
|
||||||
return Discourse.User.currentProp("admin");
|
return Discourse.User.currentProp("admin");
|
||||||
|
@ -93,11 +94,18 @@ export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
|
||||||
if (this.get('disabled')) { return; }
|
if (this.get('disabled')) { return; }
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var groupNames = this.get("groupNames");
|
var groupNames = this.get('groupNames');
|
||||||
|
var userInvitedController = this.get('controllers.user-invited');
|
||||||
|
|
||||||
this.setProperties({ saving: true, error: false });
|
this.setProperties({ saving: true, error: false });
|
||||||
this.get('model').createInvite(this.get('email'), groupNames).then(function() {
|
this.get('model').createInvite(this.get('email'), groupNames).then(function() {
|
||||||
self.setProperties({ saving: false, finished: true });
|
self.setProperties({ saving: false, finished: true });
|
||||||
|
if (!self.get('invitingToTopic')) {
|
||||||
|
Discourse.Invite.findInvitedBy(Discourse.User.current()).then(function (invite_model) {
|
||||||
|
userInvitedController.set('model', invite_model);
|
||||||
|
userInvitedController.set('totalInvites', invite_model.invites.length);
|
||||||
|
});
|
||||||
|
}
|
||||||
}).catch(function() {
|
}).catch(function() {
|
||||||
self.setProperties({ saving: false, error: true });
|
self.setProperties({ saving: false, error: true });
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,11 +8,12 @@
|
||||||
**/
|
**/
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.ObjectController.extend({
|
||||||
user: null,
|
user: null,
|
||||||
|
model: null,
|
||||||
|
totalInvites: null,
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.set('searchTerm', '');
|
this.set('searchTerm', '');
|
||||||
this.set('totalInvites', '');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadText: function() { return I18n.t("user.invited.bulk_invite.text"); }.property(),
|
uploadText: function() { return I18n.t("user.invited.bulk_invite.text"); }.property(),
|
||||||
|
|
Loading…
Reference in New Issue