diff --git a/src/app/lib/get.ts b/src/app/lib/get.ts index 1d9fb8c..85acb76 100644 --- a/src/app/lib/get.ts +++ b/src/app/lib/get.ts @@ -1,6 +1,9 @@ "use server" import prisma from "./db" export async function getStories() { + return prisma.story.findMany() +} +export async function getStoriesWithGenres() { return prisma.story.findMany( { include: { diff --git a/src/app/story/page.tsx b/src/app/story/page.tsx index 7cb6a16..93c0a71 100644 --- a/src/app/story/page.tsx +++ b/src/app/story/page.tsx @@ -1,8 +1,9 @@ import { Story } from "@prisma/client"; import { DataTable } from "./data-table"; import { columns } from "./columns"; -import { getStories } from "app/lib/get"; -const stories: Story[] = await getStories() +import { getStoriesWithGenres } from "app/lib/get"; +import { Genre } from "@prisma/client"; +const stories: Array }> = await getStoriesWithGenres() export default async function Page() { return (