From 0edc18d69458bfe19bd273cc5b92b9103516f217 Mon Sep 17 00:00:00 2001 From: HyunJinNo Date: Sat, 24 Aug 2024 23:08:28 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=97=AC=ED=96=89=EC=9D=BC=EA=B8=B0=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/diary/[id]/page.tsx | 2 +- src/components/diary/list/DiaryList.tsx | 12 ++++++++---- src/types/DiaryDto.ts | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/app/diary/[id]/page.tsx b/src/app/diary/[id]/page.tsx index 6957bbb9..3045cb4b 100644 --- a/src/app/diary/[id]/page.tsx +++ b/src/app/diary/[id]/page.tsx @@ -10,7 +10,7 @@ async function getDiary(id: number) { headers: { Cookie: `${cookie?.name}=${cookie?.value}`, }, - next: { revalidate: 3600, tags: [`getDiary/${id}`] }, + next: { revalidate: 60, tags: [`getDiary/${id}`] }, }); if (!response.ok) { diff --git a/src/components/diary/list/DiaryList.tsx b/src/components/diary/list/DiaryList.tsx index 3f6367f9..dd5ffbcf 100644 --- a/src/components/diary/list/DiaryList.tsx +++ b/src/components/diary/list/DiaryList.tsx @@ -14,7 +14,7 @@ async function getDiaryList(page: number) { headers: { Cookie: `${cookie?.name}=${cookie?.value}`, }, - next: { revalidate: 3600, tags: ["getDiaryList"] }, + next: { revalidate: 60, tags: ["getDiaryList"] }, }, ); @@ -31,6 +31,7 @@ interface Props { const DiaryList = async ({ page }: Props) => { const data = await getDiaryList(page - 1); + console.log(data); return (
@@ -46,12 +47,15 @@ const DiaryList = async ({ page }: Props) => {
- {data.diaryContentResponse.length < 6 && } - {data.diaryContentResponse.map((value, index) => ( + {data.content.length < 6 && } + {data.content.map((value, index) => ( ))}
- + ); }; diff --git a/src/types/DiaryDto.ts b/src/types/DiaryDto.ts index 9a1f1dff..3c33e216 100644 --- a/src/types/DiaryDto.ts +++ b/src/types/DiaryDto.ts @@ -37,7 +37,10 @@ export interface GetDiaryResponseDto { * 일기 목록 조회 응답 DTO */ export interface GetDiaryListResponseDto { - diaryContentResponse: { + totalPages: number; + totalElements: number; + size: number; + content: { diaryId: number; title: string; titleImage: string;