many breaking changes/fixes

This commit is contained in:
Daniel
2023-03-28 11:01:50 +03:30
parent 3a5ae28f86
commit b9567ca3c2
43 changed files with 1180 additions and 466 deletions
@@ -1,19 +1,11 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { prisma } from "@/lib/api/db";
import { Session } from "next-auth";
export default async function (
req: NextApiRequest,
res: NextApiResponse,
session: Session
) {
export default async function (userId: number) {
const collections = await prisma.collection.findMany({
where: {
ownerId: session?.user.id,
ownerId: userId,
},
});
return res.status(200).json({
response: collections || [],
});
return { response: collections, status: 200 };
}