FIX: broken suggestions (#189)

FIX: broken suggestions (#189)

We need to pass name to assignUser because it is used in 2 places. One is multiselect and another are suggestions.

diff --git a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6 b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
index bf27fee..cf4df58 100644
--- a/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
+++ b/assets/javascripts/discourse-assign/controllers/assign-user.js.es6
@@ -39,27 +39,27 @@ export default Controller.extend({
   },
 
   @action
-  assignUser(assignee) {
+  assignUser(name) {
     if (this.isBulkAction) {
-      this.bulkAction(assignee.name);
+      this.bulkAction(name);
       return;
     }
 
-    if (this.allowedGroupsForAssignment.includes(assignee.name)) {
+    if (this.allowedGroupsForAssignment.includes(name)) {
       this.setProperties({
         "model.username": null,
-        "model.group_name": assignee.name,
+        "model.group_name": name,
         "model.allowedGroups": this.taskActions.allowedGroups,
       });
     } else {
       this.setProperties({
-        "model.username": assignee.name,
+        "model.username": name,
         "model.group_name": null,
         "model.allowedGroups": this.taskActions.allowedGroups,
       });
     }
 
-    if (assignee.name) {
+    if (name) {
       return this.assign();
     }
   },
@@ -107,6 +107,6 @@ export default Controller.extend({
 
   @action
   assignUsername(selected) {
-    this.assignUser({ name: selected.firstObject });
+    this.assignUser(selected.firstObject);
   },
 });
diff --git a/assets/javascripts/discourse/templates/modal/assign-user.hbs b/assets/javascripts/discourse/templates/modal/assign-user.hbs
index 6262a0f..dcf847c 100644
--- a/assets/javascripts/discourse/templates/modal/assign-user.hbs
+++ b/assets/javascripts/discourse/templates/modal/assign-user.hbs
@@ -19,7 +19,7 @@
     }}
     <div class="assign-suggestions">
       {{#each assignSuggestions as |user|}}
-        <a href {{action "assignUser" user}}>
+        <a href {{action "assignUser" user.username }}>
           {{avatar user imageSize="small"}}
         </a>
       {{/each}}

GitHub sha: 9d7d39705e82fb718af0b09c0e85d439a97ad8bd

This commit appears in #189 which was approved by vinothkannans. It was merged by lis2.