Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const SearchModal = ({ isOpen, onClose }: SearchModalProps) => {
saveRecentSearch(store.departmentName);

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

Expand Down
1 change: 1 addition & 0 deletions apps/nowait-user/src/hooks/useInfiniteStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useApiErrorHandler } from "./useApiErrorHandler";

interface Store {
storeId: number;
publicCode : string;
bannerImages: {
id: number;
imageType: string;
Expand Down
1 change: 1 addition & 0 deletions apps/nowait-user/src/hooks/useWaitingStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface WaitingStore {
bannerImageUrl: string | null;
departmentName: string;
storeId: number;
publicCode:string;
storeName: string;
waitingCount: number;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/nowait-user/src/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const HomePage = () => {
}, []);

const handleNavigateToStore = useCallback(
(storeId: number) => {
navigate(`/store/${storeId}`);
(publicCode: string) => {
navigate(`/store/${publicCode}`);
},
[navigate]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ""}
Expand Down
6 changes: 4 additions & 2 deletions apps/nowait-user/src/pages/home/components/MainCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface WaitingCardProps {
interface StoreCardProps {
type: "store";
storeId: number;
publicCode : string;
name: string;
departmentName: string;
profileImageUrl: string;
Expand Down Expand Up @@ -276,7 +277,7 @@ const WaitingCard = ({ item }: { item: WaitingItem }) => {

// 스토어 카드 컴포넌트
const StoreCardComponent = ({
storeId,
publicCode,
name,
departmentName,
profileImageUrl,
Expand All @@ -295,7 +296,7 @@ const StoreCardComponent = ({

// 스토어 클릭 핸들러
const handleStoreClick = () => {
navigate(`/store/${storeId}`);
navigate(`/store/${publicCode}`);
};

return (
Expand Down Expand Up @@ -413,6 +414,7 @@ const MainCard = memo(
return (
<StoreCardComponent
storeId={props.storeId}
publicCode={props.publicCode}
name={props.name}
departmentName={props.departmentName}
profileImageUrl={props.profileImageUrl}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useInView } from "framer-motion";
interface SortWaitingCardProps {
order: "asc" | "desc";
onModalOpen: () => void;
onNavigateToStore: (storeId: number) => void;
onNavigateToStore: (publicCode: string) => void;
}

// 바로 입장 가능한 주점 섹션 컴포넌트
Expand Down Expand Up @@ -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)}}
/>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface PropsType {
name: string;
departmentName: string;
storeId: number;
publicCode:string;
}

const BookmarkListItem = ({
Expand All @@ -22,6 +23,7 @@ const BookmarkListItem = ({
name,
departmentName,
storeId,
publicCode
}: PropsType) => {
const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation(
{
Expand Down Expand Up @@ -49,7 +51,7 @@ const BookmarkListItem = ({
return (
<li className="mb-6">
<div className="relative top-0 right-0">
<Link to={`/store/${storeId}`}>
<Link to={`/store/${publicCode}`}>
<img
className="w-full h-[195px] rounded-[14px] overflow-hidden object-cover"
src={bannerImages || defaultMenuImageLg}
Expand All @@ -64,7 +66,7 @@ const BookmarkListItem = ({
</div>
<div className="flex items-start justify-between py-3">
<div>
<Link to={`/store/${storeId}`} className="flex items-center gap-2.5">
<Link to={`/store/${publicCode}`} className="flex items-center gap-2.5">
<DepartmentImage width="40px" height="40px" src={profileImage} />
<div className="flex flex-col justify-between">
<h1 className="text-title-16-bold text-black-90">{name}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down Expand Up @@ -61,7 +61,7 @@ const BoothDetail = ({ booth }: PropsType) => {
</span>
{waitingCount === 0 ? "대기없음" : `대기 ${waitingCount}명`}
</p>
<Button onClick={() => navigate(`/store/${storeId}`)}>상세 보기</Button>
<Button onClick={() => navigate(`/store/${publicCode}`)}>상세 보기</Button>
</div>
</motion.div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const BoothList = ({ totalBooth }: { totalBooth: number | undefined }) => {
name={store?.name}
departmentName={store?.departmentName}
storeId={store?.storeId || 0}
publicCode={store?.publicCode}
/>
</li>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface PropsType {
name: string;
departmentName: string;
storeId: number;
publicCode:string;
}

const BoothListItem = ({
Expand All @@ -22,6 +23,7 @@ const BoothListItem = ({
name,
departmentName,
storeId,
publicCode
}: PropsType) => {
const { createBookmarkMutate, deleteBookmarkMutate } = useBookmarkMutation(
{
Expand All @@ -44,7 +46,7 @@ const BoothListItem = ({
};
return (
<div className="mb-6">
<Link to={`/store/${storeId}`}>
<Link to={`/store/${publicCode}`}>
<div className="relative top-0 right-0">
<img
className="w-full h-[195px] rounded-[14px] overflow-hidden object-cover"
Expand All @@ -60,7 +62,7 @@ const BoothListItem = ({
</Link>
<div className="flex items-start justify-between py-3">
<div>
<Link to={`/store/${storeId}`} className="flex items-center gap-2.5">
<Link to={`/store/${publicCode}`} className="flex items-center gap-2.5">
<DepartmentImage width="40px" height="40px" src={profileImage} />
<div className="flex flex-col justify-between">
<h1 className="text-title-16-bold text-black-90">{name}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions apps/nowait-user/src/types/search.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface SearchStore {
storeId: number;
publicCode : string;
departmentId: number;
departmentName: string;
name: string;
Expand Down
1 change: 1 addition & 0 deletions apps/nowait-user/src/types/wait/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface StoreType {
openTime: string;
profileImage: ProfileImage;
storeId: number;
publicCode: string;
waitingCount: number;
createdAt: string;
deleted: boolean;
Expand Down