fix issues in core

This commit is contained in:
2025-12-23 15:38:50 +01:00
parent df5c20c5cc
commit 120d3bb1a1
125 changed files with 1005 additions and 793 deletions

View File

@@ -73,9 +73,23 @@ export class ReviewProtestUseCase {
await this.protestRepository.update(updatedProtest);
const protestId = (() => {
const unknownId = (protest as unknown as { id: unknown }).id;
if (typeof unknownId === 'string') return unknownId;
if (
unknownId &&
typeof unknownId === 'object' &&
'toString' in unknownId &&
typeof (unknownId as { toString: unknown }).toString === 'function'
) {
return (unknownId as { toString: () => string }).toString();
}
return String(unknownId);
})();
const result: ReviewProtestResult = {
leagueId: race.leagueId,
protestId: typeof protest.id === 'string' ? protest.id : (protest as any).id,
protestId,
status: input.decision === 'uphold' ? 'upheld' : 'dismissed',
};