added collaboration mode for collections
This commit is contained in:
@@ -8,7 +8,13 @@ import { prisma } from "@/lib/api/db";
|
||||
export default async function (userId: number) {
|
||||
const collections = await prisma.collection.findMany({
|
||||
where: {
|
||||
ownerId: userId,
|
||||
OR: [
|
||||
{ ownerId: userId },
|
||||
{ members: { some: { user: { id: userId } } } },
|
||||
],
|
||||
},
|
||||
include: {
|
||||
members: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user