perf: use bulk insert for 0-QP rows on qualifying event finalize
This commit is contained in:
parent
335d1bf015
commit
3741bcf1ce
1 changed files with 8 additions and 6 deletions
|
|
@ -140,12 +140,14 @@ export async function action({ request, params }: Route.ActionArgs) {
|
|||
existingIds
|
||||
);
|
||||
|
||||
for (const participantId of missingIds) {
|
||||
await createEventResult({
|
||||
scoringEventId: params.eventId,
|
||||
participantId,
|
||||
qualifyingPointsAwarded: 0,
|
||||
});
|
||||
if (missingIds.length > 0) {
|
||||
await createEventResultsBulk(
|
||||
missingIds.map((participantId) => ({
|
||||
scoringEventId: params.eventId,
|
||||
participantId,
|
||||
qualifyingPointsAwarded: 0,
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
return { success: "Event completed and qualifying points awarded!" };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue