mirror of
https://github.com/p-stream/backend.git
synced 2026-03-11 17:55:35 +00:00
22 lines
No EOL
471 B
TypeScript
22 lines
No EOL
471 B
TypeScript
import { prisma } from "#imports";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const id = event.context.params?.id;
|
|
const listInfo = await prisma.lists.findUnique({
|
|
where: {
|
|
id: id,
|
|
},
|
|
include: {
|
|
list_items: true,
|
|
},
|
|
});
|
|
|
|
if (!listInfo.public) {
|
|
return createError({
|
|
statusCode: 403,
|
|
message: "List is not public",
|
|
});
|
|
}
|
|
|
|
return listInfo;
|
|
}) |