Skip to content

Commit

Permalink
fix(Manage Students): Subscribe to retrieve config after remove user
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan committed Oct 8, 2023
1 parent d1aa863 commit 961c653
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ConfigService } from '../../../../services/configService';
import { ManageUserComponent } from './manage-user.component';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { of } from 'rxjs';

class ConfigServiceStub {
getPermissions() {}
getRunId() {
return 123;
}
retrieveConfig() {
return {};
return of({});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ export class ManageUserComponent {
this.http.delete(`/api/teacher/run/${runId}/student/${studentId}/remove`).subscribe({
next: () => {
this.removeUserEvent.emit(this.user);
this.snackBar.open($localize`Removed ${this.user.name} (${this.user.username}) from unit.`);
this.configService.retrieveConfig(`/api/config/classroomMonitor/${runId}`);
this.configService.retrieveConfig(`/api/config/classroomMonitor/${runId}`).subscribe({
next: () => {
this.snackBar.open(
$localize`Removed ${this.user.name} (${this.user.username}) from unit.`
);
}
});
},
error: () => {
this.snackBar.open(
Expand Down

0 comments on commit 961c653

Please sign in to comment.