Skip to content

Commit d8e6650

Browse files
authored
Merge pull request #404 from GTable/fix/user/order
fix: 주점 publicCode로 연결
2 parents 9ae0b13 + 171a853 commit d8e6650

File tree

15 files changed

+33
-21
lines changed

15 files changed

+33
-21
lines changed

apps/nowait-user/src/components/common/modal/SearchModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const SearchModal = ({ isOpen, onClose }: SearchModalProps) => {
102102
saveRecentSearch(store.departmentName);
103103

104104
// 학과별 주점 목록 페이지로 이동 (storeId를 query parameter로 전달)
105-
navigate(`/store/${store.storeId}`);
105+
navigate(`/store/${store.publicCode}`);
106106
onClose();
107107
};
108108

apps/nowait-user/src/hooks/useInfiniteStores.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useApiErrorHandler } from "./useApiErrorHandler";
55

66
interface Store {
77
storeId: number;
8+
publicCode : string;
89
bannerImages: {
910
id: number;
1011
imageType: string;

apps/nowait-user/src/hooks/useWaitingStores.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface WaitingStore {
88
bannerImageUrl: string | null;
99
departmentName: string;
1010
storeId: number;
11+
publicCode:string;
1112
storeName: string;
1213
waitingCount: number;
1314
}

apps/nowait-user/src/pages/home/HomePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ const HomePage = () => {
6060
}, []);
6161

6262
const handleNavigateToStore = useCallback(
63-
(storeId: number) => {
64-
navigate(`/store/${storeId}`);
63+
(publicCode: string) => {
64+
navigate(`/store/${publicCode}`);
6565
},
6666
[navigate]
6767
);

apps/nowait-user/src/pages/home/components/InfiniteStoreList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const InfiniteStoreList = memo(() => {
105105
key={store.storeId}
106106
type="store"
107107
storeId={store.storeId}
108+
publicCode={store.publicCode}
108109
name={store.name}
109110
departmentName={store.departmentName}
110111
profileImageUrl={store.profileImage?.imageUrl || ""}

apps/nowait-user/src/pages/home/components/MainCard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface WaitingCardProps {
1616
interface StoreCardProps {
1717
type: "store";
1818
storeId: number;
19+
publicCode : string;
1920
name: string;
2021
departmentName: string;
2122
profileImageUrl: string;
@@ -276,7 +277,7 @@ const WaitingCard = ({ item }: { item: WaitingItem }) => {
276277

277278
// 스토어 카드 컴포넌트
278279
const StoreCardComponent = ({
279-
storeId,
280+
publicCode,
280281
name,
281282
departmentName,
282283
profileImageUrl,
@@ -295,7 +296,7 @@ const StoreCardComponent = ({
295296

296297
// 스토어 클릭 핸들러
297298
const handleStoreClick = () => {
298-
navigate(`/store/${storeId}`);
299+
navigate(`/store/${publicCode}`);
299300
};
300301

301302
return (
@@ -413,6 +414,7 @@ const MainCard = memo(
413414
return (
414415
<StoreCardComponent
415416
storeId={props.storeId}
417+
publicCode={props.publicCode}
416418
name={props.name}
417419
departmentName={props.departmentName}
418420
profileImageUrl={props.profileImageUrl}

apps/nowait-user/src/pages/home/components/SortWaitingCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useInView } from "framer-motion";
88
interface SortWaitingCardProps {
99
order: "asc" | "desc";
1010
onModalOpen: () => void;
11-
onNavigateToStore: (storeId: number) => void;
11+
onNavigateToStore: (publicCode: string) => void;
1212
}
1313

1414
// 바로 입장 가능한 주점 섹션 컴포넌트
@@ -119,7 +119,7 @@ const SortWaitingCard = memo(
119119
storeName={store.storeName}
120120
departmentName={store.departmentName}
121121
waitingCount={store.waitingCount}
122-
onClick={() => onNavigateToStore(Number(store.storeId))}
122+
onClick={() => {onNavigateToStore(store.publicCode)}}
123123
/>
124124
</div>
125125
))}

apps/nowait-user/src/pages/waiting/WaitingSummary/WaitingSummaryPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const WaitingSummaryPage = () => {
2828
const payload = {
2929
partySize,
3030
};
31-
const res = await createReservation(parseInt(storeId!), payload);
31+
const res = await createReservation(Number(store?.storeId!), payload);
3232
console.log(res, "예약 응답");
3333
navigate(`/store/${storeId}/waiting/success`, { replace: true });
3434
} catch (error) {

apps/nowait-user/src/pages/waiting/bookmark/components/BookmarkListItem.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface PropsType {
1313
name: string;
1414
departmentName: string;
1515
storeId: number;
16+
publicCode:string;
1617
}
1718

1819
const BookmarkListItem = ({
@@ -22,6 +23,7 @@ const BookmarkListItem = ({
2223
name,
2324
departmentName,
2425
storeId,
26+
publicCode
2527
}: PropsType) => {
2628
const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation(
2729
{
@@ -49,7 +51,7 @@ const BookmarkListItem = ({
4951
return (
5052
<li className="mb-6">
5153
<div className="relative top-0 right-0">
52-
<Link to={`/store/${storeId}`}>
54+
<Link to={`/store/${publicCode}`}>
5355
<img
5456
className="w-full h-[195px] rounded-[14px] overflow-hidden object-cover"
5557
src={bannerImages || defaultMenuImageLg}
@@ -64,7 +66,7 @@ const BookmarkListItem = ({
6466
</div>
6567
<div className="flex items-start justify-between py-3">
6668
<div>
67-
<Link to={`/store/${storeId}`} className="flex items-center gap-2.5">
69+
<Link to={`/store/${publicCode}`} className="flex items-center gap-2.5">
6870
<DepartmentImage width="40px" height="40px" src={profileImage} />
6971
<div className="flex flex-col justify-between">
7072
<h1 className="text-title-16-bold text-black-90">{name}</h1>

apps/nowait-user/src/pages/waiting/boothMap/components/BoothDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface PropsType {
1313
const BoothDetail = ({ booth }: PropsType) => {
1414
const navigate = useNavigate();
1515

16-
const { storeId, name, departmentName, waitingCount } = booth;
16+
const { storeId, publicCode, name, departmentName, waitingCount } = booth;
1717

1818
const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation(
1919
{
@@ -61,7 +61,7 @@ const BoothDetail = ({ booth }: PropsType) => {
6161
</span>
6262
{waitingCount === 0 ? "대기없음" : `대기 ${waitingCount}명`}
6363
</p>
64-
<Button onClick={() => navigate(`/store/${storeId}`)}>상세 보기</Button>
64+
<Button onClick={() => navigate(`/store/${publicCode}`)}>상세 보기</Button>
6565
</div>
6666
</motion.div>
6767
);

0 commit comments

Comments
 (0)