From eb556f363f5b1155a804a4a8e201a96cdddaa516 Mon Sep 17 00:00:00 2001 From: mandelina Date: Sun, 19 Oct 2025 14:59:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"Refactor=20:getServerSideProps=20?= =?UTF-8?q?context=20=ED=83=80=EC=9E=85=20=EC=83=81=EC=84=B8=ED=99=94"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74eea940887131d92c8289a34e80eda4eb8e8760. --- pages/techblog/[id]/index.page.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pages/techblog/[id]/index.page.tsx b/pages/techblog/[id]/index.page.tsx index a0c3fa36..745a7ae9 100644 --- a/pages/techblog/[id]/index.page.tsx +++ b/pages/techblog/[id]/index.page.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import { GetServerSidePropsContext } from 'next'; import { useRouter } from 'next/router'; import { QueryClient, dehydrate } from '@tanstack/react-query'; @@ -27,15 +26,8 @@ import CompanyInfoCard from '../components/CompanyInfoCard'; import TechDetailCard from '../components/TechDetailCard'; import { TechCardProps } from '../types/techBlogType'; -export async function getServerSideProps(context: GetServerSidePropsContext) { - const id = context.params?.id; - - if (!id || typeof id !== 'string') { - return { - notFound: true, - }; - } - +export async function getServerSideProps(context: any) { + const { id } = context.params; const queryClient = new QueryClient(); try { From 9892103d93632518b9420bdd5caf7723512809c0 Mon Sep 17 00:00:00 2001 From: mandelina Date: Sun, 19 Oct 2025 14:59:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"=E2=9C=A8=20Feat:=20=EA=B8=B0?= =?UTF-8?q?=EC=88=A0=20=EB=B8=94=EB=A1=9C=EA=B7=B8=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EB=93=9C=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=ED=8C=A8=EC=B9=AD=20=EC=B6=94=EA=B0=80=20(=EC=83=81=EC=84=B8?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20=EB=A9=94=ED=83=80?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=8F=84=EC=9E=85=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8268030122e45318fb1f75f7a5273493213a3490. --- pages/techblog/[id]/index.page.tsx | 33 +----------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/pages/techblog/[id]/index.page.tsx b/pages/techblog/[id]/index.page.tsx index 745a7ae9..b367cd6b 100644 --- a/pages/techblog/[id]/index.page.tsx +++ b/pages/techblog/[id]/index.page.tsx @@ -2,8 +2,6 @@ import React from 'react'; import { useRouter } from 'next/router'; -import { QueryClient, dehydrate } from '@tanstack/react-query'; - import DevLoadingComponent from '@pages/loading/index.page'; import { useLoginStatusStore } from '@stores/loginStore'; @@ -19,42 +17,13 @@ import { LoginModal } from '@components/common/modals/modal'; import { ROUTES } from '@/constants/routes'; import { useMediaQueryContext } from '@/contexts/MediaQueryContext'; -import { getDetailTechBlog, useGetDetailTechBlog } from '../api/useGetTechBlogDetail'; +import { useGetDetailTechBlog } from '../api/useGetTechBlogDetail'; import { usePostMainComment } from '../api/usePostComment'; import CommentTechSection from '../components/CommentTechSection'; import CompanyInfoCard from '../components/CompanyInfoCard'; import TechDetailCard from '../components/TechDetailCard'; import { TechCardProps } from '../types/techBlogType'; -export async function getServerSideProps(context: any) { - const { id } = context.params; - const queryClient = new QueryClient(); - - try { - const postData = await getDetailTechBlog(id); - const post = postData.data; - - await queryClient.setQueryData(['techDetail', id], postData); - - const meta = { - title: post.title, - description: post.contents.substring(0, 150) + '...', - }; - - return { - props: { - dehydratedState: dehydrate(queryClient), - meta: meta, - }, - }; - } catch (error) { - console.error(`Error fetching post data for id: ${id}`, error); - return { - notFound: true, - }; - } -} - export default function Page() { const router = useRouter(); const techArticleId = router.query.id as string | undefined;