From 7127c601164420262db69da15e198da853e41825 Mon Sep 17 00:00:00 2001 From: Rajiv Sahal Date: Fri, 23 May 2025 00:48:28 +0530 Subject: [PATCH] fix: stripe integration in `EventTypeSettings` atom (#20919) Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> --- .../services/event-types-atom.service.ts | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts b/apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts index 1cccf75aef..bd469ec086 100644 --- a/apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts +++ b/apps/api/v2/src/modules/atoms/services/event-types-atom.service.ts @@ -226,20 +226,26 @@ export class EventTypesAtomService { } else { credentials = credentials.concat(teamAppCredentials); } + } else { + if (slug !== "stripe") { + // We only add delegationCredentials if the request for location options is for a user because DelegationCredential Credential is applicable to Users only. + const { credentials: allCredentials } = + await enrichUserWithDelegationConferencingCredentialsWithoutOrgId({ + user: { + ...user, + credentials, + }, + }); + credentials = allCredentials; + } } - // We only add delegationCredentials if the request for location options is for a user because DelegationCredential Credential is applicable to Users only. - const { credentials: allCredentials } = await enrichUserWithDelegationConferencingCredentialsWithoutOrgId( + + const enabledApps = await getEnabledAppsFromCredentials( + credentials as unknown as CredentialDataWithTeamName[], { - user: { - ...user, - credentials, - }, + where: { slug }, } ); - credentials = allCredentials; - const enabledApps = await getEnabledAppsFromCredentials(allCredentials, { - where: { slug }, - }); const apps = await Promise.all( enabledApps .filter(({ ...app }) => app.slug === slug)