diff --git a/apps/nowait-user/src/components/common/modal/SearchModal.tsx b/apps/nowait-user/src/components/common/modal/SearchModal.tsx index 3bddb4a7..96804479 100644 --- a/apps/nowait-user/src/components/common/modal/SearchModal.tsx +++ b/apps/nowait-user/src/components/common/modal/SearchModal.tsx @@ -102,7 +102,7 @@ const SearchModal = ({ isOpen, onClose }: SearchModalProps) => { saveRecentSearch(store.departmentName); // 학과별 주점 목록 페이지로 이동 (storeId를 query parameter로 전달) - navigate(`/store/${store.storeId}`); + navigate(`/store/${store.publicCode}`); onClose(); }; diff --git a/apps/nowait-user/src/hooks/useInfiniteStores.ts b/apps/nowait-user/src/hooks/useInfiniteStores.ts index 0e9c97ae..f1c4ad50 100644 --- a/apps/nowait-user/src/hooks/useInfiniteStores.ts +++ b/apps/nowait-user/src/hooks/useInfiniteStores.ts @@ -5,6 +5,7 @@ import { useApiErrorHandler } from "./useApiErrorHandler"; interface Store { storeId: number; + publicCode : string; bannerImages: { id: number; imageType: string; diff --git a/apps/nowait-user/src/hooks/useWaitingStores.ts b/apps/nowait-user/src/hooks/useWaitingStores.ts index a635826e..01c4ef96 100644 --- a/apps/nowait-user/src/hooks/useWaitingStores.ts +++ b/apps/nowait-user/src/hooks/useWaitingStores.ts @@ -8,6 +8,7 @@ interface WaitingStore { bannerImageUrl: string | null; departmentName: string; storeId: number; + publicCode:string; storeName: string; waitingCount: number; } diff --git a/apps/nowait-user/src/pages/home/HomePage.tsx b/apps/nowait-user/src/pages/home/HomePage.tsx index 611c1e91..dc7634ae 100644 --- a/apps/nowait-user/src/pages/home/HomePage.tsx +++ b/apps/nowait-user/src/pages/home/HomePage.tsx @@ -60,8 +60,8 @@ const HomePage = () => { }, []); const handleNavigateToStore = useCallback( - (storeId: number) => { - navigate(`/store/${storeId}`); + (publicCode: string) => { + navigate(`/store/${publicCode}`); }, [navigate] ); diff --git a/apps/nowait-user/src/pages/home/components/InfiniteStoreList.tsx b/apps/nowait-user/src/pages/home/components/InfiniteStoreList.tsx index 575b80d4..f3359e4a 100644 --- a/apps/nowait-user/src/pages/home/components/InfiniteStoreList.tsx +++ b/apps/nowait-user/src/pages/home/components/InfiniteStoreList.tsx @@ -105,6 +105,7 @@ const InfiniteStoreList = memo(() => { key={store.storeId} type="store" storeId={store.storeId} + publicCode={store.publicCode} name={store.name} departmentName={store.departmentName} profileImageUrl={store.profileImage?.imageUrl || ""} diff --git a/apps/nowait-user/src/pages/home/components/MainCard.tsx b/apps/nowait-user/src/pages/home/components/MainCard.tsx index 2ebe21f9..16f6b922 100644 --- a/apps/nowait-user/src/pages/home/components/MainCard.tsx +++ b/apps/nowait-user/src/pages/home/components/MainCard.tsx @@ -16,6 +16,7 @@ interface WaitingCardProps { interface StoreCardProps { type: "store"; storeId: number; + publicCode : string; name: string; departmentName: string; profileImageUrl: string; @@ -276,7 +277,7 @@ const WaitingCard = ({ item }: { item: WaitingItem }) => { // 스토어 카드 컴포넌트 const StoreCardComponent = ({ - storeId, + publicCode, name, departmentName, profileImageUrl, @@ -295,7 +296,7 @@ const StoreCardComponent = ({ // 스토어 클릭 핸들러 const handleStoreClick = () => { - navigate(`/store/${storeId}`); + navigate(`/store/${publicCode}`); }; return ( @@ -413,6 +414,7 @@ const MainCard = memo( return ( void; - onNavigateToStore: (storeId: number) => void; + onNavigateToStore: (publicCode: string) => void; } // 바로 입장 가능한 주점 섹션 컴포넌트 @@ -119,7 +119,7 @@ const SortWaitingCard = memo( storeName={store.storeName} departmentName={store.departmentName} waitingCount={store.waitingCount} - onClick={() => onNavigateToStore(Number(store.storeId))} + onClick={() => {onNavigateToStore(store.publicCode)}} /> ))} diff --git a/apps/nowait-user/src/pages/waiting/WaitingSummary/WaitingSummaryPage.tsx b/apps/nowait-user/src/pages/waiting/WaitingSummary/WaitingSummaryPage.tsx index 36e67dc5..ca426490 100644 --- a/apps/nowait-user/src/pages/waiting/WaitingSummary/WaitingSummaryPage.tsx +++ b/apps/nowait-user/src/pages/waiting/WaitingSummary/WaitingSummaryPage.tsx @@ -28,7 +28,7 @@ const WaitingSummaryPage = () => { const payload = { partySize, }; - const res = await createReservation(parseInt(storeId!), payload); + const res = await createReservation(Number(store?.storeId!), payload); console.log(res, "예약 응답"); navigate(`/store/${storeId}/waiting/success`, { replace: true }); } catch (error) { diff --git a/apps/nowait-user/src/pages/waiting/bookmark/components/BookmarkListItem.tsx b/apps/nowait-user/src/pages/waiting/bookmark/components/BookmarkListItem.tsx index 241144aa..52ca3c35 100644 --- a/apps/nowait-user/src/pages/waiting/bookmark/components/BookmarkListItem.tsx +++ b/apps/nowait-user/src/pages/waiting/bookmark/components/BookmarkListItem.tsx @@ -13,6 +13,7 @@ interface PropsType { name: string; departmentName: string; storeId: number; + publicCode:string; } const BookmarkListItem = ({ @@ -22,6 +23,7 @@ const BookmarkListItem = ({ name, departmentName, storeId, + publicCode }: PropsType) => { const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation( { @@ -49,7 +51,7 @@ const BookmarkListItem = ({ return (
  • - +
    - +

    {name}

    diff --git a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothDetail.tsx b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothDetail.tsx index 9b9c7c0c..a445ea69 100644 --- a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothDetail.tsx +++ b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothDetail.tsx @@ -13,7 +13,7 @@ interface PropsType { const BoothDetail = ({ booth }: PropsType) => { const navigate = useNavigate(); - const { storeId, name, departmentName, waitingCount } = booth; + const { storeId, publicCode, name, departmentName, waitingCount } = booth; const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation( { @@ -61,7 +61,7 @@ const BoothDetail = ({ booth }: PropsType) => { {waitingCount === 0 ? "대기없음" : `대기 ${waitingCount}명`}

    - +
    ); diff --git a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothList.tsx b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothList.tsx index d842ae43..5fbcdd6d 100644 --- a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothList.tsx +++ b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothList.tsx @@ -122,6 +122,7 @@ const BoothList = ({ totalBooth }: { totalBooth: number | undefined }) => { name={store?.name} departmentName={store?.departmentName} storeId={store?.storeId || 0} + publicCode={store?.publicCode} />
  • ); diff --git a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothListItem.tsx b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothListItem.tsx index 3512ed01..35b34770 100644 --- a/apps/nowait-user/src/pages/waiting/boothMap/components/BoothListItem.tsx +++ b/apps/nowait-user/src/pages/waiting/boothMap/components/BoothListItem.tsx @@ -13,6 +13,7 @@ interface PropsType { name: string; departmentName: string; storeId: number; + publicCode:string; } const BoothListItem = ({ @@ -22,6 +23,7 @@ const BoothListItem = ({ name, departmentName, storeId, + publicCode }: PropsType) => { const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation( { @@ -44,7 +46,7 @@ const BoothListItem = ({ }; return (
    - +
    - +

    {name}

    diff --git a/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx b/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx index d53ef57c..9f688afa 100644 --- a/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx +++ b/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx @@ -22,12 +22,6 @@ const StoreDetailPage = () => { const navigate = useNavigate(); const { id: storeId } = useParams(); - const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation( - { withInvalidate: true }, - Number(storeId) - ); - const { isBookmarked } = useBookmarkState(Number(storeId)); - const { data: store, isLoading, @@ -37,13 +31,19 @@ const StoreDetailPage = () => { queryFn: () => getStore(storeId!), select: (data) => data?.response, }); - + const { data: menus, isLoading: menusIsLoading } = useQuery({ queryKey: ["storeMenus", storeId], queryFn: () => getStoreMenus(storeId!), select: (data) => data?.response, }); + const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation( + { withInvalidate: true }, + Number(store?.storeId!) + ); + const { isBookmarked } = useBookmarkState(Number(store?.storeId!)); + const handleBookmarkButton = async () => { try { if (!isBookmarked) { diff --git a/apps/nowait-user/src/types/search.ts b/apps/nowait-user/src/types/search.ts index 20d7073f..54ef39d5 100644 --- a/apps/nowait-user/src/types/search.ts +++ b/apps/nowait-user/src/types/search.ts @@ -1,5 +1,6 @@ export interface SearchStore { storeId: number; + publicCode : string; departmentId: number; departmentName: string; name: string; diff --git a/apps/nowait-user/src/types/wait/store.ts b/apps/nowait-user/src/types/wait/store.ts index 83cca296..2d219b35 100644 --- a/apps/nowait-user/src/types/wait/store.ts +++ b/apps/nowait-user/src/types/wait/store.ts @@ -65,6 +65,7 @@ export interface StoreType { openTime: string; profileImage: ProfileImage; storeId: number; + publicCode: string; waitingCount: number; createdAt: string; deleted: boolean;