From da3dc74a7e6e83cabc9215ec522c5a9ccf6ee741 Mon Sep 17 00:00:00 2001 From: yuminnnnni Date: Sun, 15 Nov 2026 18:27:37 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix(api):=20=EC=97=AC=ED=96=89=20=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=EB=8A=94=20ApiError=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=A0=EC=A7=80=ED=95=98=EA=B3=A0=20=EB=B6=81=EB=A7=88?= =?UTF-8?q?=ED=81=AC=20=EC=8B=A4=ED=8C=A8=20=EB=AC=B8=EA=B5=AC=EC=97=90?= =?UTF-8?q?=EC=84=9C=20API=20=EC=9B=90=EB=AC=B8=20=EC=A0=9C=EA=B1=B0=20(GL?= =?UTF-8?q?B-240,=20GLB-242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getDiariesByUuid가 ApiError를 일반 Error로 바꿔 서버 페이지에서 401·5xx를 구분할 수 없었음 - 북마크 조회·저장 취소 실패 시 HTTP 상태와 응답 본문이 화면 문구에 붙었음 --- apps/web/src/services/bookmarkService.ts | 10 +++------- apps/web/src/services/diaryService.ts | 2 ++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/web/src/services/bookmarkService.ts b/apps/web/src/services/bookmarkService.ts index d3740461..f7cb83e6 100644 --- a/apps/web/src/services/bookmarkService.ts +++ b/apps/web/src/services/bookmarkService.ts @@ -52,9 +52,7 @@ export const getBookmarks = async (token?: string, useToken = true): Promise => { try { await apiDelete(`/api/v1/bookmarks/${targetMemberId}`, undefined, token); - } catch (error) { - if (error instanceof Error) { - throw new Error(`지구본 저장 취소에 실패했습니다: ${error.message}`); - } + } catch { + // 화면에는 API 오류 원문 대신 고정 문구를 보여 줌 (GLB-240) throw new Error("지구본 저장을 취소하는 데 실패했습니다. 잠시 후 다시 시도해주세요."); } }; diff --git a/apps/web/src/services/diaryService.ts b/apps/web/src/services/diaryService.ts index a1628906..91a97acf 100644 --- a/apps/web/src/services/diaryService.ts +++ b/apps/web/src/services/diaryService.ts @@ -196,6 +196,8 @@ export const getDiariesByUuid = async (uuid: string, token?: string): Promise Date: Sun, 15 Nov 2026 18:27:38 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix(record):=20=EA=B8=B0=EB=A1=9D=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20scrollIndex=EB=A5=BC=20=EB=B2=94=EC=9C=84?= =?UTF-8?q?=20=EC=95=88=EC=9C=BC=EB=A1=9C=20=EB=A7=9E=EC=B6=94=EA=B3=A0=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=A4=ED=8C=A8=EB=A5=BC=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=99=94=EB=A9=B4=C2=B7=EA=B3=A0=EC=A0=95=20?= =?UTF-8?q?=EB=AC=B8=EA=B5=AC=EB=A1=9C=20=EC=B2=98=EB=A6=AC=20(GLB-153,=20?= =?UTF-8?q?GLB-240,=20GLB-242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scrollIndex가 기록 수보다 크거나 숫자가 아니면 헤더까지 없는 빈 화면이 됐음 --- apps/web/src/app/record/[id]/page.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/record/[id]/page.tsx b/apps/web/src/app/record/[id]/page.tsx index 9c54a725..f9e7b22e 100644 --- a/apps/web/src/app/record/[id]/page.tsx +++ b/apps/web/src/app/record/[id]/page.tsx @@ -8,6 +8,7 @@ import RecordDetailClient from "@/components/record/RecordDetailClient"; import RecordDetailViewTracker from "@/components/record/RecordDetailViewTracker"; import { AUTH_COOKIE } from "@/constants/authCookies"; import { getDiariesByUuid } from "@/services/diaryService"; +import { handleServerError } from "@/utils/serverErrorHandler"; type RecordData = { id: string; @@ -93,11 +94,19 @@ export default async function RecordDetailPage({ } } } catch (error) { - serverError = error instanceof Error ? error.message : "기록을 불러오는 중 오류가 발생했습니다"; + // 401·5xx는 다른 서버 페이지처럼 오류 화면으로 보냄 (GLB-242) + handleServerError(error); + // 그 밖의 실패는 API 오류 원문 대신 고정 문구로 안내함 (GLB-240) + serverError = "여행 기록을 불러오는 데 실패했습니다. 잠시 후 다시 시도해주세요."; } } - const initialScrollIndex = scrollIndexParam ? Number(scrollIndexParam) : 0; + // 범위 밖이거나 숫자가 아닌 scrollIndex로 들어와도 빈 화면이 되지 않도록 기록 범위 안으로 맞춤 (GLB-153) + const parsedScrollIndex = Number(scrollIndexParam); + const lastRecordIndex = Math.max(initialRecords.length - 1, 0); + const initialScrollIndex = Number.isInteger(parsedScrollIndex) + ? Math.min(Math.max(parsedScrollIndex, 0), lastRecordIndex) + : 0; const selectedRecord = initialRecords.find(r => r.cityId === cityId); From 35b75cc418e7b478bbc335f72024856a529030c6 Mon Sep 17 00:00:00 2001 From: yuminnnnni Date: Sun, 15 Nov 2026 18:27:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix(record):=20=EA=B8=B0=EB=A1=9D=EC=9D=B4?= =?UTF-8?q?=201=EA=B0=9C=EC=9D=B8=20=EC=83=81=EC=84=B8=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=97=90=EC=84=9C=20=EC=82=AC=EC=A7=84=20=ED=95=80?= =?UTF-8?q?=EC=B9=98=20=EC=8B=9C=20=ED=8E=98=EC=9D=B4=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=ED=95=A8=EA=BB=98=20=ED=99=95=EB=8C=80=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EA=B2=8C=20=ED=95=A8=20(GLB-265)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/record/RecordDetailClient.tsx | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/web/src/components/record/RecordDetailClient.tsx b/apps/web/src/components/record/RecordDetailClient.tsx index 52bcbabf..aa7706a2 100644 --- a/apps/web/src/components/record/RecordDetailClient.tsx +++ b/apps/web/src/components/record/RecordDetailClient.tsx @@ -169,19 +169,22 @@ const RecordDetailClient = ({ const recordContent = countryRecords.length === 1 ? ( - + // 기록이 여러 개일 때 RecordScrollContainer가 주는 touch-action을 1개일 때도 줘서 사진 핀치 중 페이지가 함께 확대되지 않게 함 (GLB-265) +
+ +
) : ( <>