fix issues in core
This commit is contained in:
@@ -55,11 +55,11 @@ export class FileProtestUseCase {
|
||||
|
||||
// Validate protesting driver is a member of the league
|
||||
const memberships = await this.leagueMembershipRepository.getLeagueMembers(race.leagueId);
|
||||
const protestingDriverMembership = memberships.find(m => {
|
||||
const driverId = (m as any).driverId;
|
||||
const status = (m as any).status;
|
||||
return driverId === command.protestingDriverId && status === 'active';
|
||||
});
|
||||
const protestingDriverMembership = memberships.find(
|
||||
m =>
|
||||
m.driverId.toString() === command.protestingDriverId &&
|
||||
m.status.toString() === 'active',
|
||||
);
|
||||
|
||||
if (!protestingDriverMembership) {
|
||||
return Result.err({ code: 'NOT_MEMBER', details: { message: 'Protesting driver is not an active member of this league' } });
|
||||
|
||||
Reference in New Issue
Block a user