wip league admin tools
This commit is contained in:
@@ -58,7 +58,17 @@ export class CompleteRaceUseCaseWithRatings {
|
||||
});
|
||||
}
|
||||
|
||||
if (race.status === 'completed') {
|
||||
const raceStatus = (race as unknown as { status?: unknown }).status;
|
||||
const isCompleted =
|
||||
typeof raceStatus === 'string'
|
||||
? raceStatus === 'completed'
|
||||
: typeof (raceStatus as { isCompleted?: unknown })?.isCompleted === 'function'
|
||||
? (raceStatus as { isCompleted: () => boolean }).isCompleted()
|
||||
: typeof (raceStatus as { toString?: unknown })?.toString === 'function'
|
||||
? (raceStatus as { toString: () => string }).toString() === 'completed'
|
||||
: false;
|
||||
|
||||
if (isCompleted) {
|
||||
return Result.err({
|
||||
code: 'ALREADY_COMPLETED',
|
||||
details: { message: 'Race already completed' }
|
||||
|
||||
Reference in New Issue
Block a user