perf: handleChildrenEventTypes createManyAndReturn (#25652)

* perf: handleChildrenEventTypes createManyAndReturn

* fix: update test mocks for createManyAndReturn

Co-Authored-By: [email protected] <[email protected]>

* fix: use full EventType shape in createManyAndReturn mock return values

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-12-08 10:21:57 +00:00
1 parent b91f27dc80
commit 1e673f1df4
2 files changed
+65 -101

No files matched your search

@@ -241,14 +241,9 @@ export default async function handleChildrenEventTypes({
});
await prisma.$transaction(async (tx) => {
await tx.eventType.createMany({
const createdEvents = await tx.eventType.createManyAndReturn({
data: eventTypesToCreateData,
skipDuplicates: true,
});
// Fetch the newly created event types to connect users and workflows
const createdEvents = await tx.eventType.findMany({
where: { parentId: parentId, userId: { in: newUserIds } },
select: { id: true, userId: true },
});