LP#1849212: (follow-up) fixes to removing users from course
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 15 Sep 2020 01:14:05 +0000 (21:14 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 15 Sep 2020 01:14:05 +0000 (21:14 -0400)
* correctly extract the IDs of the user mappings to remove
* update the grid upon completion of the deletions

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts

index f2aa9de..f281342 100644 (file)
@@ -124,8 +124,8 @@ export class CourseAssociateUsersComponent extends DialogComponent implements On
     }
 
     deleteSelectedUsers(users) {
-        const user_ids = [];
-        this.pcrud.search('acmcu', {course: this.courseId, usr: user_ids}).subscribe(user => {
+        const acmcu_ids = users.map(u => u.id());
+        this.pcrud.search('acmcu', {course: this.courseId, id: acmcu_ids}).subscribe(user => {
             user.isdeleted(true);
             this.pcrud.autoApply(user).subscribe(
                 val => {
@@ -138,7 +138,7 @@ export class CourseAssociateUsersComponent extends DialogComponent implements On
                         .then(str => this.toast.danger(str));
                 }
             );
-        });
+        }).add(() => this.usersGrid.reload());
     }
 
 }