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
|
existingIds
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const participantId of missingIds) {
|
if (missingIds.length > 0) {
|
||||||
await createEventResult({
|
await createEventResultsBulk(
|
||||||
scoringEventId: params.eventId,
|
missingIds.map((participantId) => ({
|
||||||
participantId,
|
scoringEventId: params.eventId,
|
||||||
qualifyingPointsAwarded: 0,
|
participantId,
|
||||||
});
|
qualifyingPointsAwarded: 0,
|
||||||
|
}))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { success: "Event completed and qualifying points awarded!" };
|
return { success: "Event completed and qualifying points awarded!" };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue