2023-02-18 21:32:02 -06:00
|
|
|
import { prisma } from "@/lib/api/db";
|
|
|
|
|
2023-03-28 02:31:50 -05:00
|
|
|
export default async function (userId: number) {
|
2023-02-18 21:32:02 -06:00
|
|
|
const collections = await prisma.collection.findMany({
|
|
|
|
where: {
|
2023-03-28 02:31:50 -05:00
|
|
|
ownerId: userId,
|
2023-02-18 21:32:02 -06:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2023-03-28 02:31:50 -05:00
|
|
|
return { response: collections, status: 200 };
|
2023-02-18 21:32:02 -06:00
|
|
|
}
|