TD-4: Bannen funktioniert
All checks were successful
Quality Check / Linting (push) Successful in 23s
All checks were successful
Quality Check / Linting (push) Successful in 23s
This commit is contained in:
parent
acc1dc9bea
commit
560a7ddfbb
3 changed files with 5 additions and 3 deletions
3
src/app/core/auth/UserData.d.ts
vendored
3
src/app/core/auth/UserData.d.ts
vendored
|
@ -1,7 +1,8 @@
|
|||
interface UserData {
|
||||
username: string,
|
||||
verified: boolean,
|
||||
id: number
|
||||
id: number,
|
||||
banned: boolean
|
||||
}
|
||||
|
||||
export default UserData;
|
||||
|
|
|
@ -23,7 +23,8 @@ export class AuthService implements CanActivate {
|
|||
this.$user.next(isLoggedIn ? {
|
||||
username: userData.preferred_username,
|
||||
verified: userData.email_verified,
|
||||
id: userData.id
|
||||
id: userData.id,
|
||||
banned: userData.banned
|
||||
} : undefined);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export class DashboardComponent implements OnInit {
|
|||
|
||||
banPlayer(user: UserData): void {
|
||||
console.log(`Banning user: ${user.username}`);
|
||||
this.adminService.banPlayer(user.id);
|
||||
this.adminService.banPlayer(user.id).subscribe(()=>{});
|
||||
this.fetchPlayers('');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue