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
8 changes: 4 additions & 4 deletions apps/nowait-user/src/api/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ interface MenuServerResponse {
}

//주점에 해당하는 모든 메뉴 조회
export const getStoreMenus = async (storeId: number) => {
export const getStoreMenus = async (publicCode: string) => {
try {
const res = await axios.get<AllMenuServerResponse>(
`${API_URI}/v1/menus/all-menus/stores/${storeId}`
`${API_URI}/v1/menus/all-menus/stores/${publicCode}`
);
if (res?.data.success) return res.data;
} catch (error) {
Expand All @@ -33,9 +33,9 @@ export const getStoreMenus = async (storeId: number) => {

// 단일 메뉴 조회
export const getStoreMenu = async (
storeId: number,
publicCode: string,
menuId: number
): Promise<MenuServerResponse> => {
const res = await axios.get(`${API_URI}/v1/menus/${storeId}/${menuId}`);
const res = await axios.get(`${API_URI}/v1/menus/${publicCode}/${menuId}`);
return res.data;
};
12 changes: 6 additions & 6 deletions apps/nowait-user/src/api/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ const API_URI = import.meta.env.VITE_SERVER_URI;

//주문 생성
export const createOrder = async (
storeId: number,
publicCode: string,
tableId: number,
payload: OrderType
): Promise<CreateOrderServerResponse> => {
const res = await api.post(`/orders/create/${storeId}/${tableId}`, payload);
const res = await api.post(`/orders/create/${publicCode}/${tableId}`, payload);
return res.data;
};

//주문 내역 조회
export const getOrderDetails = async (
storeId: number | undefined,
publicCode: string,
tableId: number
): Promise<OrderDetailsServerResponse> => {
const res = await api.get(`/orders/items/${storeId}/${tableId}`);
const res = await api.get(`/orders/items/${publicCode}/${tableId}`);
return res.data;
};

//주점 QR, 계좌번호 조회
export const getStorePayments = async (storeId: number) => {
export const getStorePayments = async (publicCode: string) => {
try {
const res = await axios.get<StorePaymentsResponse>(
`${API_URI}/v1/store-payments/${storeId}`
`${API_URI}/v1/store-payments/${publicCode}`
);
return res.data;
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions apps/nowait-user/src/api/reservation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const getInfiniteAllStores = async (
};

// 주점 상세 정보 가져오기
export const getStore = async (storeId: number | undefined) => {
export const getStore = async (publicCode: string) => {
try {
const res = await UserApi.get<StoreResponse>(`/v1/stores/${storeId}`);
const res = await UserApi.get<StoreResponse>(`/v1/stores/${publicCode}`);
return res.data;
} catch (error) {
console.log(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CancelWaitingModal = ({
{/* 취소 버튼 */}
<button
onClick={onClose}
className="flex-1 px-3 py-2.5 rounded-[10px] bg-black-20 text-[16px] font-semibold leading-[136%] tracking-normal text-black-65 items-center justify-center"
className="flex-1 py-2.5 rounded-[10px] bg-black-20 text-[16px] font-semibold leading-[136%] tracking-normal text-black-65 items-center justify-center"
>
취소
</button>
Expand Down
4 changes: 2 additions & 2 deletions apps/nowait-user/src/pages/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LoginImage_3 from "../../assets/login/login_img_3.svg?react";
const LoginPage = () => {
return (
<div className="flex flex-col px-6 overflow-x-hidden h-[100dvh]">
<div className="mt-15 flex justify-start">
<div className="mt-10 flex justify-start">
<Logo className="w-14.5 h-6" />
</div>
<div className="mt-3 text-start">
Expand All @@ -17,7 +17,7 @@ const LoginPage = () => {
우리의 즐거운 축제
</text>
</div>
<div className="mt-16 mx-[-24px] flex justify-center">
<div className="mt-12.5 mx-[-24px] flex justify-center">
<div className="w-[432px] aspect-square flex-shrink-0 flex items-center justify-center">
<img src={LoginImage_1} alt="login_img_1" className="w-full" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/nowait-user/src/pages/order/addMenu/AddMenuPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AddMenuPage = () => {

const { data: menu, isLoading } = useQuery({
queryKey: ["menu", menuId],
queryFn: () => getStoreMenu(Number(storeId!), Number(menuId!)),
queryFn: () => getStoreMenu(storeId!, Number(menuId!)),
select: (data) => data?.response,
});

Expand Down
4 changes: 2 additions & 2 deletions apps/nowait-user/src/pages/order/home/StorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const StorePage = () => {

const { data: menus, isLoading } = useQuery({
queryKey: ["storeMenus", storeId],
queryFn: () => getStoreMenus(Number(storeId!)),
queryFn: () => getStoreMenus(storeId!),
select: (data) => data?.response,
});


console.log(menus,"asd")
return (
<div>
<div className="flex flex-col flex-grow pb-[112px] min-h-dvh pt-7.5 px-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const OrderDetailsPage = () => {

const { data: orderDetails, isLoading } = useQuery({
queryKey: ["orderDetails", storeId],
queryFn: () => getOrderDetails(Number(storeId!), Number(tableId!)),
queryFn: () => getOrderDetails(storeId!, Number(tableId!)),
select: (data) => data?.response,
});
console.log(orderDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const OrderListPage = () => {

const { data: menus } = useQuery({
queryKey: ["storeMenuList", storeId],
queryFn: () => getStoreMenus(Number(storeId!)),
queryFn: () => getStoreMenus(storeId!),
select: (data) => data?.response?.menuReadDto,
});
// 장바구니와 최신 메뉴 데이터 동기화
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const RemittancePage = () => {

const { data: remittance, isLoading } = useQuery({
queryKey: ["remittance", storeId],
queryFn: () => getStorePayments(Number(storeId!)),
queryFn: () => getStorePayments(storeId!),
enabled: !!storeId,
select: (data) => data?.response,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const RemittanceWaitPage = () => {
totalPrice,
};
const res = await createOrder(
Number(storeId!),
storeId!,
Number(tableId!),
payload
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const WaitingSummaryPage = () => {
const [reservationIsLoading, setReservationIsLoading] = useState(false);
const { data: store, isLoading } = useQuery({
queryKey: ["store", storeId],
queryFn: () => getStore(storeId ? parseInt(storeId) : undefined),
queryFn: () => getStore(storeId!),
select: (data) => data?.response,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ const StoreDetailPage = () => {
isError,
} = useQuery({
queryKey: ["store", storeId],
queryFn: () => getStore(Number(storeId!)),
queryFn: () => getStore(storeId!),
select: (data) => data?.response,
});
console.log(store)
const { data: menus, isLoading: menusIsLoading } = useQuery({
queryKey: ["storeMenus", storeId],
queryFn: () => getStoreMenus(Number(storeId!)),
queryFn: () => getStoreMenus(storeId!),
select: (data) => data?.response,
});

Expand Down
1 change: 1 addition & 0 deletions apps/nowait-user/src/types/order/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface CreateOrderServerResponse {
response: {
orderId: number;
storeId: number;
publicCode: string;
storeName: string;
sessionId: string;
depositorName: string;
Expand Down
4 changes: 0 additions & 4 deletions apps/nowait-user/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"source": "/api/banner-images/:path*",
"destination": "https://gtablestoreimage.s3.ap-northeast-2.amazonaws.com/:path*"
},
{
"source": "/orders/:path*",
"destination": "https://nowait.co.kr/orders/:path*"
},
{ "source": "/(.*)", "destination": "/index.html" }
],
"headers": [
Expand Down