brackt/app/routes/admin.sports-seasons.$id.events.$eventId.helpers.ts
Chris Parsons 8723000cdd feat: add batch-add-results server intent with duplicate filtering
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 14:18:04 -07:00

10 lines
404 B
TypeScript

/**
* Filter incoming batch results to only those whose participantId
* is not already in the set of existing result participantIds.
*/
export function filterNewResults(
incoming: { participantId: string; placement: number }[],
existingParticipantIds: Set<string>
): { participantId: string; placement: number }[] {
return incoming.filter((r) => !existingParticipantIds.has(r.participantId));
}