page wrapper
This commit is contained in:
@@ -38,6 +38,7 @@ export default function LeagueSchedule({ leagueId }: LeagueScheduleProps) {
|
||||
const confirmed = window.confirm(`Register for ${race.track ?? race.name}?`);
|
||||
|
||||
if (!confirmed) return;
|
||||
if (!currentDriverId) return;
|
||||
|
||||
try {
|
||||
await registerMutation.mutateAsync({ raceId: race.id, leagueId, driverId: currentDriverId });
|
||||
@@ -52,6 +53,7 @@ export default function LeagueSchedule({ leagueId }: LeagueScheduleProps) {
|
||||
const confirmed = window.confirm('Withdraw from this race?');
|
||||
|
||||
if (!confirmed) return;
|
||||
if (!currentDriverId) return;
|
||||
|
||||
try {
|
||||
await withdrawMutation.mutateAsync({ raceId: race.id, driverId: currentDriverId });
|
||||
@@ -265,4 +267,4 @@ export default function LeagueSchedule({ leagueId }: LeagueScheduleProps) {
|
||||
}}
|
||||
</StateContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user