diff --git a/packages/web/src/prisma.ts b/packages/web/src/prisma.ts index 1908c5fb..1d4b7585 100644 --- a/packages/web/src/prisma.ts +++ b/packages/web/src/prisma.ts @@ -32,14 +32,16 @@ export const userScopedPrismaClientExtension = (userId?: string) => { args.where = { ...args.where, OR: [ - // Only include repos that are permitted to the user, - { - permittedUsers: { - some: { - userId, + // Only include repos that are permitted to the user + ...(userId ? [ + { + permittedUsers: { + some: { + userId, + } } - } - }, + }, + ] : []), // or are public. { isPublic: true,