fix issues in core
This commit is contained in:
@@ -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',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user