fix: removing apps from team events (#14182)

* fix: removing apps from team events

* fix: lnstalling an app to a team enables it on all the team-events by default
This commit is contained in:
Somay Chauhan
2024-03-22 13:42:49 -04:00
committed by GitHub
parent fbff9a9a3f
commit 9acc21d882
@@ -53,7 +53,17 @@ export const deleteCredentialHandler = async ({ ctx, input }: DeleteCredentialOp
const eventTypes = await prisma.eventType.findMany({
where: {
userId: ctx.user.id,
OR: [
{
...(teamId ? { teamId } : { userId: ctx.user.id }),
},
// for managed events
{
parent: {
teamId,
},
},
],
},
select: {
id: true,
@@ -147,6 +157,7 @@ export const deleteCredentialHandler = async ({ ctx, input }: DeleteCredentialOp
...metadata?.apps,
stripe: {
...metadata?.apps?.stripe,
enabled: false,
price: 0,
},
},