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:
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 },
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user