From 79d56820099106a5074c7ed17feba02972ca6efa Mon Sep 17 00:00:00 2001 From: Sohyunnnn Date: Fri, 3 Apr 2026 23:48:28 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=EC=95=8C=EB=A6=BC=20=EA=B5=AC?= =?UTF-8?q?=EB=8F=85=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audience/src/pages/notice-list/notice-list.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/audience/src/pages/notice-list/notice-list.tsx b/apps/audience/src/pages/notice-list/notice-list.tsx index b351b524..7111a552 100644 --- a/apps/audience/src/pages/notice-list/notice-list.tsx +++ b/apps/audience/src/pages/notice-list/notice-list.tsx @@ -18,9 +18,10 @@ import { formatDday } from '@amp/shared/utils'; import { useToggleWishListMutation } from '@features/usecase/toggle-wishlist/use-toggle-wishlist-mutation'; import { NOTICES_QUERY_OPTIONS } from '@entities/notice/model/query-options'; +import { USER_QUERY_OPTIONS } from '@entities/user/model/query-options'; import { CATEGORY_CODE_BY_LABEL } from '@shared/constants/category-label'; -import { NAV_PATH } from '@shared/constants/path'; +import { NAV_PATH, ROUTE_PATH } from '@shared/constants/path'; import { useNotificationsSubscribeMutation } from '@shared/hooks/use-festival-notification'; import { useLiveStatus } from '@shared/hooks/use-live-status'; import LiveStatusSheet from '@shared/ui/live-status-sheet/live-status-sheet'; @@ -42,6 +43,8 @@ const NoticeListPage = () => { NOTICES_QUERY_OPTIONS.BANNER(festivalId), ); + const { data: nicknameData } = useQuery(USER_QUERY_OPTIONS.NICKNAME()); + const { data } = useQuery( NOTICES_QUERY_OPTIONS.LIST(festivalId, { page: 0, @@ -98,6 +101,10 @@ const NoticeListPage = () => { : null; const handleAlertClick = () => { + if (nicknameData?.nickname === '관객') { + navigate(ROUTE_PATH.AUTH_REQUIRED); + return; + } overlay.open(({ isOpen, close, unmount }) => { const handleConfirmAlert = async () => { try { From 5957a0293e06e5a4f5eb027a038e8695c4410b1a Mon Sep 17 00:00:00 2001 From: Sohyunnnn Date: Mon, 6 Apr 2026 23:09:10 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20status=20=EA=B4=80=EB=A0=A8=20API?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audience/src/entities/auth/api/auth.ts | 8 ++++++++ .../src/entities/auth/model/query-options.ts | 13 +++++++++++++ apps/audience/src/entities/auth/types/response.ts | 5 +++++ apps/audience/src/pages/notice-list/notice-list.tsx | 6 +++--- apps/audience/src/shared/constants/end-point.ts | 1 + apps/audience/src/shared/constants/query-key.ts | 1 + 6 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 apps/audience/src/entities/auth/api/auth.ts create mode 100644 apps/audience/src/entities/auth/model/query-options.ts create mode 100644 apps/audience/src/entities/auth/types/response.ts diff --git a/apps/audience/src/entities/auth/api/auth.ts b/apps/audience/src/entities/auth/api/auth.ts new file mode 100644 index 00000000..ed82948c --- /dev/null +++ b/apps/audience/src/entities/auth/api/auth.ts @@ -0,0 +1,8 @@ +import { get } from '@amp/apis'; + +import { AuthStatusResponse } from '@entities/auth/types/response'; + +import { END_POINT } from '@shared/constants/end-point'; + +export const getAuthStatus = () => + get(END_POINT.GET_AUTH_STATUS); diff --git a/apps/audience/src/entities/auth/model/query-options.ts b/apps/audience/src/entities/auth/model/query-options.ts new file mode 100644 index 00000000..04399b0e --- /dev/null +++ b/apps/audience/src/entities/auth/model/query-options.ts @@ -0,0 +1,13 @@ +import { queryOptions } from '@tanstack/react-query'; + +import { getAuthStatus } from '@entities/auth/api/auth'; + +import { USERS_QUERY_KEY } from '@shared/constants/query-key'; + +export const AUTH_QUERY_OPTIONS = { + AUTH_STATUS: () => + queryOptions({ + queryKey: USERS_QUERY_KEY.AUTH_STATUS(), + queryFn: () => getAuthStatus(), + }), +} as const; diff --git a/apps/audience/src/entities/auth/types/response.ts b/apps/audience/src/entities/auth/types/response.ts new file mode 100644 index 00000000..0f0b9d0c --- /dev/null +++ b/apps/audience/src/entities/auth/types/response.ts @@ -0,0 +1,5 @@ +export interface AuthStatusResponse { + authenticated: boolean; + email: string; + userType: string; +} diff --git a/apps/audience/src/pages/notice-list/notice-list.tsx b/apps/audience/src/pages/notice-list/notice-list.tsx index 7111a552..dbebeb63 100644 --- a/apps/audience/src/pages/notice-list/notice-list.tsx +++ b/apps/audience/src/pages/notice-list/notice-list.tsx @@ -17,8 +17,8 @@ import { formatDday } from '@amp/shared/utils'; import { useToggleWishListMutation } from '@features/usecase/toggle-wishlist/use-toggle-wishlist-mutation'; +import { AUTH_QUERY_OPTIONS } from '@entities/auth/model/query-options'; import { NOTICES_QUERY_OPTIONS } from '@entities/notice/model/query-options'; -import { USER_QUERY_OPTIONS } from '@entities/user/model/query-options'; import { CATEGORY_CODE_BY_LABEL } from '@shared/constants/category-label'; import { NAV_PATH, ROUTE_PATH } from '@shared/constants/path'; @@ -43,7 +43,7 @@ const NoticeListPage = () => { NOTICES_QUERY_OPTIONS.BANNER(festivalId), ); - const { data: nicknameData } = useQuery(USER_QUERY_OPTIONS.NICKNAME()); + const { data: statusData } = useQuery(AUTH_QUERY_OPTIONS.AUTH_STATUS()); const { data } = useQuery( NOTICES_QUERY_OPTIONS.LIST(festivalId, { @@ -101,7 +101,7 @@ const NoticeListPage = () => { : null; const handleAlertClick = () => { - if (nicknameData?.nickname === '관객') { + if (statusData?.authenticated === false) { navigate(ROUTE_PATH.AUTH_REQUIRED); return; } diff --git a/apps/audience/src/shared/constants/end-point.ts b/apps/audience/src/shared/constants/end-point.ts index 5f578a86..508aff8d 100644 --- a/apps/audience/src/shared/constants/end-point.ts +++ b/apps/audience/src/shared/constants/end-point.ts @@ -37,4 +37,5 @@ export const END_POINT = { // Auth POST_LOGOUT: '/auth/logout', POST_ONBOARDING_COMPLETE: '/auth/onboarding/complete', + GET_AUTH_STATUS: '/auth/status' } as const; diff --git a/apps/audience/src/shared/constants/query-key.ts b/apps/audience/src/shared/constants/query-key.ts index 2cfd8fc4..b3a364b3 100644 --- a/apps/audience/src/shared/constants/query-key.ts +++ b/apps/audience/src/shared/constants/query-key.ts @@ -61,4 +61,5 @@ export const USERS_QUERY_KEY = { ], NICKNAME: () => [...USERS_QUERY_KEY.ALL, 'nickname'], + AUTH_STATUS: () => [...USERS_QUERY_KEY.ALL, 'auth-status'], } as const; From 063219370c68ee3b564d1f13a425a992a46739a8 Mon Sep 17 00:00:00 2001 From: Sohyunnnn Date: Mon, 6 Apr 2026 23:24:27 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20=EB=9E=98=EB=B9=97=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audience/src/entities/auth/api/auth.ts | 2 +- apps/audience/src/entities/auth/types/response.ts | 2 +- apps/audience/src/shared/constants/end-point.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/audience/src/entities/auth/api/auth.ts b/apps/audience/src/entities/auth/api/auth.ts index ed82948c..60e5d188 100644 --- a/apps/audience/src/entities/auth/api/auth.ts +++ b/apps/audience/src/entities/auth/api/auth.ts @@ -1,6 +1,6 @@ import { get } from '@amp/apis'; -import { AuthStatusResponse } from '@entities/auth/types/response'; +import type { AuthStatusResponse } from '@entities/auth/types/response'; import { END_POINT } from '@shared/constants/end-point'; diff --git a/apps/audience/src/entities/auth/types/response.ts b/apps/audience/src/entities/auth/types/response.ts index 0f0b9d0c..6ff2ee8c 100644 --- a/apps/audience/src/entities/auth/types/response.ts +++ b/apps/audience/src/entities/auth/types/response.ts @@ -1,5 +1,5 @@ export interface AuthStatusResponse { authenticated: boolean; email: string; - userType: string; + userType: "AUDIENCE"| "ORGANIZER"| null; } diff --git a/apps/audience/src/shared/constants/end-point.ts b/apps/audience/src/shared/constants/end-point.ts index 508aff8d..15c13686 100644 --- a/apps/audience/src/shared/constants/end-point.ts +++ b/apps/audience/src/shared/constants/end-point.ts @@ -37,5 +37,5 @@ export const END_POINT = { // Auth POST_LOGOUT: '/auth/logout', POST_ONBOARDING_COMPLETE: '/auth/onboarding/complete', - GET_AUTH_STATUS: '/auth/status' + GET_AUTH_STATUS: '/auth/status', } as const;