mirror of
https://github.com/p-stream/backend.git
synced 2026-04-20 19:52:09 +00:00
22 lines
411 B
TypeScript
22 lines
411 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;
|
|
});
|