Many changes.

This commit is contained in:
Daniel
2023-02-19 07:02:02 +03:30
parent d19204f4c0
commit e0f4c71eb2
19 changed files with 282 additions and 122 deletions
@@ -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 || [],
});
}