Invallers
All checks were successful
Gitea/swiss-client/pipeline/head This commit looks good

This commit is contained in:
2025-09-18 23:28:02 +02:00
parent 02b884bbcf
commit 6a9ea43e23
5 changed files with 13 additions and 9 deletions

View File

@@ -9,9 +9,9 @@
<mat-form-field appearance="fill"> <mat-form-field appearance="fill">
<mat-label>Invaller</mat-label> <mat-label>Invaller</mat-label>
<mat-select [(ngModel)]="substitution.substitute"> <mat-select [(ngModel)]="substitution.substitute">
<mat-option>Geen</mat-option> <mat-option [value]="-1">Geen</mat-option>
@for (player of data.availablePlayers; track player.playerId) { @for (player of data.availablePlayers; track player.id) {
<mat-option [value]="player"> <mat-option [value]="player.id">
{{ player.name }} {{ player.name }}
</mat-option> </mat-option>
} }

View File

@@ -5,10 +5,10 @@ import {
MatDialogActions, MatDialogActions,
MatDialogClose, MatDialogClose,
MatDialogContent, MatDialogContent,
MatDialogRef, MatDialogTitle MatDialogRef,
MatDialogTitle
} from "@angular/material/dialog"; } from "@angular/material/dialog";
import {MatFormField} from "@angular/material/form-field"; import {MatFormField, MatLabel} from "@angular/material/form-field";
import {MatLabel} from "@angular/material/form-field";
import {MatOption, MatSelect} from "@angular/material/select"; import {MatOption, MatSelect} from "@angular/material/select";
import {TournamentPlayer} from "../../model/tournamentPlayer"; import {TournamentPlayer} from "../../model/tournamentPlayer";
import {FormsModule} from "@angular/forms"; import {FormsModule} from "@angular/forms";
@@ -29,7 +29,8 @@ import {Event} from "../../model/event";
MatDialogClose, MatDialogClose,
], ],
templateUrl: './substitute-selection.component.html', templateUrl: './substitute-selection.component.html',
styleUrl: './substitute-selection.component.scss' styleUrl: './substitute-selection.component.scss',
standalone: true
}) })
export class SubstituteSelectionComponent { export class SubstituteSelectionComponent {

View File

@@ -83,6 +83,7 @@ export class TournamentPlayersComponent implements OnInit {
console.log(result.substitutions[1].event + ': ' + result.substitutions[1].substitute); console.log(result.substitutions[1].event + ': ' + result.substitutions[1].substitute);
this.tournamentService.playerSubstitute(this.tournament.id, player.playerId, result.substitutions).subscribe(data => { this.tournamentService.playerSubstitute(this.tournament.id, player.playerId, result.substitutions).subscribe(data => {
this.tournament = data; this.tournament = data;
console.log(this.tournament);
}); });
} }
}); });

View File

@@ -1,5 +1,6 @@
export class TournamentPlayer { export class TournamentPlayer {
id: number;
playerId: number; playerId: number;
name: string; name: string;
events: string[]; events: string[];
@@ -13,5 +14,6 @@ export class TournamentPlayer {
export class TournamentPlayerSubstitution { export class TournamentPlayerSubstitution {
substitutionId: number; substitutionId: number;
event: string; event: string;
substitute: TournamentPlayer; // substitute: TournamentPlayer;
substitute: number = -1;
} }