From 42dd76cf4db41c1a628f81fad4036c89f3c34428 Mon Sep 17 00:00:00 2001 From: bicochan Date: Tue, 24 Jun 2025 13:24:50 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EC=A1=B0=ED=9A=8C=20=EB=A1=9C=EC=A7=81=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 --- packages/common/components/src/api/popup.ts | 4 ++-- packages/common/components/src/ui/header/index.tsx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/common/components/src/api/popup.ts b/packages/common/components/src/api/popup.ts index 85c5ac312..0fee0f5b7 100644 --- a/packages/common/components/src/api/popup.ts +++ b/packages/common/components/src/api/popup.ts @@ -54,9 +54,9 @@ interface PageableList { const client = getApiClient(); -export const getPopupList = async () => { +export const getUserPopupList = async () => { const response = await client.get>( - `${ENDPOINT.CMS_SERVICE.POPUPS}`, + `${ENDPOINT.CMS_SERVICE.POPUPS}/user/list`, ); return response.data; }; diff --git a/packages/common/components/src/ui/header/index.tsx b/packages/common/components/src/ui/header/index.tsx index 6e0f89393..8457b28dd 100644 --- a/packages/common/components/src/ui/header/index.tsx +++ b/packages/common/components/src/ui/header/index.tsx @@ -8,7 +8,7 @@ import { ENDPOINT } from "../../config"; import { setCookie, getCookie } from "../../lib"; import { getPopupInfo, - getPopupList, + getUserPopupList, getSiteInfo, getUserInfo, type PopupInfo, @@ -45,9 +45,9 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) { enabled: !viewOnly, }); - const { data: popupList } = useQuery({ + const { data: userPopupList } = useQuery({ queryKey: [ENDPOINT.CMS_SERVICE.POPUPS], - queryFn: () => getPopupList(), + queryFn: () => getUserPopupList(), }); const openPopup = useCallback(async (popup: PopupInfo) => { @@ -79,16 +79,16 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) { }, []); useEffect(() => { - if (!popupList?.content.length) return; + if (!userPopupList?.content?.length) return; const timer = setTimeout(() => { - popupList.content.forEach((popup) => { + userPopupList.content.forEach((popup) => { openPopup(popup); }); }, 500); return () => clearTimeout(timer); - }, [popupList, openPopup]); + }, [userPopupList, openPopup]); return (