Fixed user filter #133

This commit is contained in:
Sven Heidemann 2023-02-20 20:30:43 +01:00
parent dfcd958965
commit 15214b1c99

View File

@ -18,6 +18,7 @@ import { Mutations } from "../../../../models/graphql/mutations.model";
import { throwError } from "rxjs"; import { throwError } from "rxjs";
import { UpdateUserMutationResult } from "../../../../models/graphql/result.model"; import { UpdateUserMutationResult } from "../../../../models/graphql/result.model";
import { ActivatedRoute } from "@angular/router"; import { ActivatedRoute } from "@angular/router";
import { Level } from "../../../../models/data/level.model";
@Component({ @Component({
selector: "app-members", selector: "app-members",
@ -64,7 +65,7 @@ export class MembersComponent implements OnInit {
discordId: FormControl<number | null>, discordId: FormControl<number | null>,
name: FormControl<string | null>, name: FormControl<string | null>,
leftServer: FormControl<boolean | null>, leftServer: FormControl<boolean | null>,
level: FormControl<number | null> level: FormControl<Level | null>
}>; }>;
filter: UserFilter = {}; filter: UserFilter = {};
@ -130,7 +131,7 @@ export class MembersComponent implements OnInit {
discordId: new FormControl<number | null>(null), discordId: new FormControl<number | null>(null),
name: [""], name: [""],
leftServer: new FormControl<boolean | null>(null), leftServer: new FormControl<boolean | null>(null),
level: new FormControl<number | null>(null) level: new FormControl<Level | null>(null)
}); });
this.filterForm.valueChanges.pipe( this.filterForm.valueChanges.pipe(
@ -162,7 +163,7 @@ export class MembersComponent implements OnInit {
if (changes.level) { if (changes.level) {
this.filter.level = { this.filter.level = {
id: changes.level id: changes.level.id
}; };
} else { } else {
this.filter.level = undefined; this.filter.level = undefined;