From dc0262e721e8afd2cf17439c1866c07eb134c7b9 Mon Sep 17 00:00:00 2001 From: dmdgpdi Date: Mon, 30 Dec 2024 18:00:54 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=EC=95=A1=EC=84=B8=EC=8A=A4=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20=EB=A7=8C=EB=A3=8C=EB=90=98=EC=97=88?= =?UTF-8?q?=EC=9D=84=20=EB=95=8C,=20=EB=A6=AC=EB=8B=A4=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/techpick/src/apis/apiClient.ts | 10 ++++++---- frontend/techpick/src/constants/errorMessageJson.ts | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/techpick/src/apis/apiClient.ts b/frontend/techpick/src/apis/apiClient.ts index 2f2f21ba7..bc20d87a5 100644 --- a/frontend/techpick/src/apis/apiClient.ts +++ b/frontend/techpick/src/apis/apiClient.ts @@ -21,10 +21,12 @@ export const apiClient = ky.create({ const parsedErrorMessage = error.message.split(' '); const errorCode = parsedErrorMessage.shift(); - if (!errorCode) { - /* empty */ - } else if (ERROR_MESSAGE_JSON[errorCode]) { - notifyError(ERROR_MESSAGE_JSON[errorCode]); + if (errorCode && ERROR_MESSAGE_JSON[errorCode]) { + if (errorCode === 'AU-001') { + window.location.href = '/login'; + } else { + notifyError(ERROR_MESSAGE_JSON[errorCode]); + } } } diff --git a/frontend/techpick/src/constants/errorMessageJson.ts b/frontend/techpick/src/constants/errorMessageJson.ts index e652d3f0e..7bda3aef2 100644 --- a/frontend/techpick/src/constants/errorMessageJson.ts +++ b/frontend/techpick/src/constants/errorMessageJson.ts @@ -1,4 +1,5 @@ export const ERROR_MESSAGE_JSON: { [key: string]: string } = { + 'AU-001': '로그인 해주세요.', 'PK-000': '존재하지 않는 북마크입니다.', 'PK-001': '이미 존재하는 북마크입니다! 북마크 저장을 실패했습니다!', 'PK-002': '접근할 수 없는 북마크입니다.', From d53f69b97dec7fcbfe0a3f469750ae5e3acc90d9 Mon Sep 17 00:00:00 2001 From: dmdgpdi Date: Mon, 30 Dec 2024 18:05:54 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20redirect=5Furl=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/techpick/src/app/(unsigned)/login/failed/page.tsx | 4 ++-- frontend/techpick/src/app/(unsigned)/login/page.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/techpick/src/app/(unsigned)/login/failed/page.tsx b/frontend/techpick/src/app/(unsigned)/login/failed/page.tsx index eba2d7d97..17c69dd4f 100644 --- a/frontend/techpick/src/app/(unsigned)/login/failed/page.tsx +++ b/frontend/techpick/src/app/(unsigned)/login/failed/page.tsx @@ -39,7 +39,7 @@ export default function LoginFailedPage() {
Date: Mon, 30 Dec 2024 18:13:02 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=ED=83=9C=EA=B7=B8=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=EA=B8=B8=EC=9D=B4=EA=B0=80=20200?= =?UTF-8?q?=EC=9D=B4=20=EB=84=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EB=B0=9C=EC=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PickTagPicker/PickTagAutocompleteDialog.tsx | 8 +++----- .../components/PickTagPicker/TagInfoEditPopoverButton.tsx | 8 +++----- frontend/techpick/src/constants/errorMessageJson.ts | 1 + 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/techpick/src/components/PickTagPicker/PickTagAutocompleteDialog.tsx b/frontend/techpick/src/components/PickTagPicker/PickTagAutocompleteDialog.tsx index 0e65cedee..045b70f34 100644 --- a/frontend/techpick/src/components/PickTagPicker/PickTagAutocompleteDialog.tsx +++ b/frontend/techpick/src/components/PickTagPicker/PickTagAutocompleteDialog.tsx @@ -13,7 +13,7 @@ import { usePickStore, useUpdatePickStore, } from '@/stores'; -import { notifyError, numberToRandomColor } from '@/utils'; +import { numberToRandomColor } from '@/utils'; import { DeleteTagDialog } from './DeleteTagDialog'; import { DeselectTagButton } from './DeselectTagButton'; import { SelectedTagItem } from '../SelectedTagItem'; @@ -100,10 +100,8 @@ export function PickTagAutocompleteDialog({ }); randomNumber.current = getRandomInt(); onSelectTag(newTag!); - } catch (error) { - if (error instanceof Error) { - notifyError(error.message); - } + } catch { + /* empty */ } finally { isCreateFetchPendingRef.current = false; } diff --git a/frontend/techpick/src/components/PickTagPicker/TagInfoEditPopoverButton.tsx b/frontend/techpick/src/components/PickTagPicker/TagInfoEditPopoverButton.tsx index 0a4719bd2..eebaee0e6 100644 --- a/frontend/techpick/src/components/PickTagPicker/TagInfoEditPopoverButton.tsx +++ b/frontend/techpick/src/components/PickTagPicker/TagInfoEditPopoverButton.tsx @@ -7,7 +7,7 @@ import DOMPurify from 'dompurify'; import { EllipsisIcon } from 'lucide-react'; import { useDisclosure } from '@/hooks'; import { useTagStore } from '@/stores'; -import { notifyError, isEmptyString, isShallowEqualValue } from '@/utils'; +import { isEmptyString, isShallowEqualValue } from '@/utils'; import { ShowDeleteTagDialogButton } from './ShowDeleteTagDialogButton'; import { tagInfoEditFormLayout, @@ -60,10 +60,8 @@ export function TagInfoEditPopoverButton({ name: newTagName, colorNumber: tag.colorNumber, }); - } catch (error) { - if (error instanceof Error) { - notifyError(error.message); - } + } catch { + /* empty */ } }; diff --git a/frontend/techpick/src/constants/errorMessageJson.ts b/frontend/techpick/src/constants/errorMessageJson.ts index 7bda3aef2..372f1f75e 100644 --- a/frontend/techpick/src/constants/errorMessageJson.ts +++ b/frontend/techpick/src/constants/errorMessageJson.ts @@ -18,6 +18,7 @@ export const ERROR_MESSAGE_JSON: { [key: string]: string } = { 'TG-001': '중복된 태그가 존재합니다.', 'TG-002': '유효하지 않는 태그 이름입니다.', 'TG-003': '잘못된 태그에 접근했습니다.', + 'TG-005': '태그명이 허용된 최대길이를 초과했습니다.', 'LI-000': '존재하지 않는 링크입니다.', 'LI-002': '이미 존재하는 링크입니다.', 'LI-003': '이 링크는 넣을 수 없습니다. ㅠㅠ', From 001d5b83c9a5c88d5a1c4da60c2ae0b5ae5e9f74 Mon Sep 17 00:00:00 2001 From: dmdgpdi Date: Mon, 30 Dec 2024 22:41:03 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20ERROR=5FMESSAGE=5FJSON=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/techpick/src/constants/errorMessageJson.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/techpick/src/constants/errorMessageJson.ts b/frontend/techpick/src/constants/errorMessageJson.ts index 372f1f75e..a81519caa 100644 --- a/frontend/techpick/src/constants/errorMessageJson.ts +++ b/frontend/techpick/src/constants/errorMessageJson.ts @@ -1,5 +1,5 @@ export const ERROR_MESSAGE_JSON: { [key: string]: string } = { - 'AU-001': '로그인 해주세요.', + 'AU-001': '로그인 정보가 확인되지 않았습니다.\n로그인 후 다시 시도해주세요.', 'PK-000': '존재하지 않는 북마크입니다.', 'PK-001': '이미 존재하는 북마크입니다! 북마크 저장을 실패했습니다!', 'PK-002': '접근할 수 없는 북마크입니다.',