Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdrb278 committed May 17, 2023
1 parent 096110f commit b9225a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Home({posts}: homeProps) {
)
}

export const getStaticProps = async () => {
export const getServerSideProps = async () => {
const posts = await prisma.post.findMany({
include: {
author: true,
Expand Down
4 changes: 2 additions & 2 deletions pages/post/detail/[postId].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { post } from '@/interface/post';
import { GetStaticPaths, GetStaticProps } from 'next';
import { GetStaticPaths, GetServerSideProps } from 'next';
import { dateToHowover, calculateReadingTime } from '@/lib/helper';
import { RemoteControler } from '@/components/common/RemoteControler';
import ReactMarkdown from 'react-markdown';
Expand Down Expand Up @@ -44,7 +44,7 @@ export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
};
};

export const getStaticProps: GetStaticProps = async (context) => {
export const getServerSideProps: GetServerSideProps = async (context) => {
if (context.params?.postId) {
const postId = context.params.postId.toString();
const post = await prisma.post.findUnique({
Expand Down

0 comments on commit b9225a2

Please sign in to comment.