fix: DelegationCredential - Duplicate GoogleMeet and unnecessary serviceAccount key access (#21269)

* Remove unused return statement

* Fix return from fn instead of continuing the loop

* Ensure userId is set for existing records on update

* ensure that serviceAccountKey is only retrieved whenb assked
This commit is contained in:
Hariom Balhara authored and GitHub committed 2025-05-14 09:49:47 +00:00
1 parent deb55c0536
commit df75df7008
32 files changed
+196 -113

No files matched your search

@@ -1,6 +1,6 @@
import type { Prisma } from "@prisma/client";
import { enrichUserWithDelegationCredentialsWithoutOrgId } from "@calcom/lib/delegationCredential/server";
import { enrichUserWithDelegationCredentialsIncludeServiceAccountKey } from "@calcom/lib/delegationCredential/server";
import { availabilityUserSelect } from "@calcom/prisma";
import { prisma } from "@calcom/prisma";
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
@@ -23,7 +23,7 @@ export async function findUsersForAvailabilityCheck({ where }: { where: Prisma.U
return null;
}
return await enrichUserWithDelegationCredentialsWithoutOrgId({
return await enrichUserWithDelegationCredentialsIncludeServiceAccountKey({
user: withSelectedCalendars(user),
});
}