wip league admin tools
This commit is contained in:
@@ -74,7 +74,7 @@ export class GetRaceDetailUseCase {
|
||||
? registrations.some(reg => reg.driverId.toString() === driverId)
|
||||
: false;
|
||||
|
||||
const isUpcoming = race.status === 'scheduled' && race.scheduledAt > new Date();
|
||||
const isUpcoming = race.status.isScheduled() && race.scheduledAt > new Date();
|
||||
const canRegister =
|
||||
typeof driverId === 'string' && driverId.length > 0
|
||||
? !!membership && membership.status.toString() === 'active' && isUpcoming
|
||||
@@ -82,7 +82,7 @@ export class GetRaceDetailUseCase {
|
||||
|
||||
let userResult: RaceResult | null = null;
|
||||
|
||||
if (race.status === 'completed' && typeof driverId === 'string' && driverId.length > 0) {
|
||||
if (race.status.isCompleted() && typeof driverId === 'string' && driverId.length > 0) {
|
||||
const results = await this.resultRepository.findByRaceId(race.id);
|
||||
userResult = results.find(r => r.driverId.toString() === driverId) ?? null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user