Many changes.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { prisma } from "@/lib/api/db";
|
||||
import { Session } from "next-auth";
|
||||
|
||||
export default async function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse,
|
||||
session: Session
|
||||
) {
|
||||
const collections = await prisma.collection.findMany({
|
||||
where: {
|
||||
ownerId: session?.user.id,
|
||||
},
|
||||
});
|
||||
|
||||
return res.status(200).json({
|
||||
response: collections || [],
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user