Add beer post, brewery post GET service and page

Add prettier, eslint config
This commit is contained in:
Aaron William Po
2023-01-22 20:56:33 -05:00
parent a434e1bb98
commit 0065525f5c
29 changed files with 8696 additions and 6977 deletions

View File

@@ -1,24 +1,7 @@
import { PrismaClient } from "@prisma/client";
import type { BeerPost } from "@prisma/client";
import { GetServerSideProps, NextPage } from "next";
import { NextPage } from 'next';
export const getServerSideProps: GetServerSideProps<{}> = async () => {
const prisma = new PrismaClient();
const beerPosts = await prisma.beerPost.findMany();
return {
props: {
beerPosts,
},
};
};
interface HomePageProps {
beerPosts: BeerPost[];
}
const Home: NextPage<HomePageProps> = ({ beerPosts }) => {
console.log(beerPosts);
return <h1 className="text-3xl font-bold underline">Hello world!</h1>;
const Home: NextPage = () => {
return <h1 className="text-3xl font-bold underline">Hello world!</h1>;
};
export default Home;