Only return enabled apps in getEnabledApps (#6653)

pull/6654/head
Alex van Andel 2023-01-23 23:27:20 +00:00 committed by GitHub
parent cfa8fd8b67
commit 3e005919c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -3,8 +3,10 @@ import type { CredentialData } from "@calcom/app-store/utils";
import { prisma } from "@calcom/prisma";
const getEnabledApps = async (userCredentials: CredentialData[]) => {
const enabledApps = await prisma.app.findMany({ select: { slug: true, enabled: true } });
const enabledApps = await prisma.app.findMany({
where: { enabled: true },
select: { slug: true, enabled: true },
});
const apps = getApps(userCredentials);
const filteredApps = enabledApps.reduce((reducedArray, app) => {