From c9c083108a3a962ada614e39a97d60e42d6dbd4a Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Sun, 15 Nov 2015 00:57:11 +0530 Subject: [PATCH] FIX: show error when user already exists in group --- .../javascripts/discourse/controllers/group/members.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/group/members.js.es6 b/app/assets/javascripts/discourse/controllers/group/members.js.es6 index 29294d154..3234c1c21 100644 --- a/app/assets/javascripts/discourse/controllers/group/members.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group/members.js.es6 @@ -1,3 +1,5 @@ +import { popupAjaxError } from 'discourse/lib/ajax-error'; + export default Ember.Controller.extend({ loading: false, limit: null, @@ -22,7 +24,7 @@ export default Ember.Controller.extend({ addMembers() { const usernames = this.get('usernames'); if (usernames && usernames.length > 0) { - this.get('model').addMembers(usernames).then(() => this.set('usernames', [])); + this.get('model').addMembers(usernames).then(() => this.set('usernames', [])).catch(popupAjaxError); } },