diff --git a/src/app/publication/[id]/page.tsx b/src/app/publication/[id]/page.tsx new file mode 100644 index 0000000..2287750 --- /dev/null +++ b/src/app/publication/[id]/page.tsx @@ -0,0 +1,37 @@ +import prisma from "app/lib/db"; +import { columns } from "app/submission/columns"; +import GenreBadges from "app/ui/genreBadges"; +import { PageHeader, PageSubHeader } from "app/ui/pageHeader"; +import { DataTable } from "app/ui/tables/data-table"; + +async function getPubWithGenres(id: string) { + return prisma.pub.findFirst({ + where: { id: Number(id) }, + include: { genres: true } + }) +} + +async function getPubSubmissions(id: string) { + return prisma.sub.findMany({ + where: { storyId: Number(id) }, + include: { + story: true, + pub: true, + response: true + } + }) +} + + +export default async function Page({ params }: { params: { id: string } }) { + const pub = await getPubWithGenres(params.id) + const pubSubs = await getPubSubmissions(params.id) + return ( +