initial commit
This commit is contained in:
19
app/page.tsx
Normal file
19
app/page.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { prisma } from "../lib/prisma"
|
||||
import Link from 'next/link'
|
||||
import Post from './post'
|
||||
|
||||
const allPosts = await prisma.post.findMany({
|
||||
include: {
|
||||
pet: true
|
||||
}
|
||||
});
|
||||
|
||||
export default async function Page() {
|
||||
const posts = allPosts.map(item => <Post key={item.id} postData={item}></Post>);
|
||||
return <>
|
||||
<h1>Posts</h1>
|
||||
{posts}
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user