We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a51fe7 commit a386364Copy full SHA for a386364
packages/web/src/prisma.ts
@@ -32,14 +32,16 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
32
args.where = {
33
...args.where,
34
OR: [
35
- // Only include repos that are permitted to the user,
36
- {
37
- permittedUsers: {
38
- some: {
39
- userId,
+ // Only include repos that are permitted to the user
+ ...(userId ? [
+ {
+ permittedUsers: {
+ some: {
40
+ userId,
41
+ }
42
}
- }
- },
43
+ },
44
+ ] : []),
45
// or are public.
46
{
47
isPublic: true,
0 commit comments