mirror of
https://codeberg.org/beerbrawl/beerbrawl.git
synced 2024-09-22 21:20:52 +02:00
Merge branch 'fix/#177/prevent-team-registration-when-tournament-is-started' into 'development'
fix(#177): prevent team registration when tournament is already started Closes #177 See merge request 2024ss-se-pr-group/24ss-se-pr-qse-11!139
This commit is contained in:
commit
4ea5e9fd59
|
@ -62,7 +62,7 @@ public class TournamentTeamServiceImpl implements TournamentTeamService {
|
|||
throw new BadTournamentPublicAccessTokenException();
|
||||
}
|
||||
|
||||
if (tournament.getRegistrationEnd().isBefore(BeerDateTime.nowUtc())) {
|
||||
if (tournament.getRegistrationEnd().isBefore(BeerDateTime.nowUtc()) || !tournament.getQualificationMatches().isEmpty()) {
|
||||
return SignupTeamResult.REGISTRATION_CLOSED;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
@if (nameFormControl.errors?.maxParticipantsReached) {
|
||||
<mat-error>No more spots left!</mat-error>
|
||||
}
|
||||
@if (nameFormControl.errors?.registrationClosed) {
|
||||
<mat-error> Registration is closed! </mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<button mat-raised-button type="submit">Sign up!</button>
|
||||
</form>
|
||||
|
|
|
@ -80,6 +80,9 @@ export class TeamSignupComponent {
|
|||
case TournamentSignupTeamResponseDto.SignupTeamResultEnum.MaxParticipantsReached:
|
||||
this.nameFormControl.setErrors({ maxParticipantsReached: true });
|
||||
return of();
|
||||
case TournamentSignupTeamResponseDto.SignupTeamResultEnum.RegistrationClosed:
|
||||
this.nameFormControl.setErrors({ registrationClosed: true });
|
||||
return of();
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue