Fix no-shadow lint error in scoring-event.ts
Rename the inner maxGameNumberByEvent local inside the IIFE to `map` so it no longer shadows the outer destructuring target of the same name. https://claude.ai/code/session_01NpQNGWacjg7mbnq8aaUweJ
This commit is contained in:
parent
e5728fd7ed
commit
ff9bc6717c
1 changed files with 5 additions and 5 deletions
|
|
@ -627,8 +627,8 @@ export async function getUpcomingEventsForDraftedParticipants(
|
|||
(async () => {
|
||||
// Determine max game number per event across ALL games (not date-filtered)
|
||||
// so we can distinguish single-game matchups from multi-game series.
|
||||
const maxGameNumberByEvent = new Map<string, number>();
|
||||
if (eventIdsFromRows.length === 0) return maxGameNumberByEvent;
|
||||
const map = new Map<string, number>();
|
||||
if (eventIdsFromRows.length === 0) return map;
|
||||
|
||||
const allGameRows = await db
|
||||
.selectDistinct({
|
||||
|
|
@ -648,11 +648,11 @@ export async function getUpcomingEventsForDraftedParticipants(
|
|||
|
||||
for (const row of allGameRows) {
|
||||
if (row.gameNumber !== null) {
|
||||
const current = maxGameNumberByEvent.get(row.eventId) ?? 0;
|
||||
maxGameNumberByEvent.set(row.eventId, Math.max(current, row.gameNumber));
|
||||
const current = map.get(row.eventId) ?? 0;
|
||||
map.set(row.eventId, Math.max(current, row.gameNumber));
|
||||
}
|
||||
}
|
||||
return maxGameNumberByEvent;
|
||||
return map;
|
||||
})(),
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue