el.xwx.moe/lib/api/controllers/collections/getCollections.ts
2023-03-28 11:01:50 +03:30

12 lines
247 B
TypeScript

import { prisma } from "@/lib/api/db";
export default async function (userId: number) {
const collections = await prisma.collection.findMany({
where: {
ownerId: userId,
},
});
return { response: collections, status: 200 };
}