diff --git a/apps/nowait-user/src/api/menu.ts b/apps/nowait-user/src/api/menu.ts index 10be6841..dd2aca4d 100644 --- a/apps/nowait-user/src/api/menu.ts +++ b/apps/nowait-user/src/api/menu.ts @@ -23,7 +23,7 @@ interface MenuServerResponse { export const getStoreMenus = async (publicCode: string) => { try { const res = await axios.get( - `${API_URI}/v1/menus/all-menus/stores/${publicCode}` + `${API_URI}/v1/stores/${publicCode}/menus` ); if (res?.data.success) return res.data; } catch (error) { @@ -36,6 +36,6 @@ export const getStoreMenu = async ( publicCode: string, menuId: number ): Promise => { - const res = await axios.get(`${API_URI}/v1/menus/${publicCode}/${menuId}`); + const res = await axios.get(`${API_URI}/v1/stores/${publicCode}/menus/${menuId}`); return res.data; }; diff --git a/apps/nowait-user/src/api/order.ts b/apps/nowait-user/src/api/order.ts index d9278c6c..6318a65d 100644 --- a/apps/nowait-user/src/api/order.ts +++ b/apps/nowait-user/src/api/order.ts @@ -5,6 +5,7 @@ import type { OrderType, StorePaymentsResponse, } from "../types/order/order"; + const API_URI = import.meta.env.VITE_SERVER_URI; const api = axios.create({ @@ -20,7 +21,7 @@ export const createOrder = async ( payload: OrderType ): Promise => { const res = await api.post( - `/orders/create/${publicCode}/${tableId}`, + `v1/stores/${publicCode}/tables/${tableId}/orders`, payload ); return res.data; @@ -31,7 +32,7 @@ export const getOrderDetails = async ( publicCode: string, tableId: number ): Promise => { - const res = await api.get(`/orders/items/${publicCode}/${tableId}`); + const res = await api.get(`v1/stores/${publicCode}/tables/${tableId}/orders`); return res.data; }; @@ -39,7 +40,7 @@ export const getOrderDetails = async ( export const getStorePayments = async (publicCode: string) => { try { const res = await axios.get( - `${API_URI}/v1/store-payments/${publicCode}` + `${API_URI}/v1/stores/${publicCode}/payments` ); return res.data; } catch (error) { diff --git a/apps/nowait-user/src/api/reservation.ts b/apps/nowait-user/src/api/reservation.ts index 941d838a..214a64a3 100644 --- a/apps/nowait-user/src/api/reservation.ts +++ b/apps/nowait-user/src/api/reservation.ts @@ -14,7 +14,7 @@ interface ServerResponse { // 모든 주점 정보 가져오기 export const getAllStores = async () => { - const response = await UserApi.get("/v1/stores/all-stores", { + const response = await UserApi.get("/v1/stores", { params: { page: 0, size: 50, @@ -27,7 +27,7 @@ export const getAllStores = async () => { export const getInfiniteAllStores = async ( pageParam: number ): Promise<{ storePageReadResponses: StoreType[]; hasNext: boolean }> => { - const response = await UserApi.get("/v1/stores/all-stores", { + const response = await UserApi.get("/v1/stores", { params: { page: pageParam, size: 5, @@ -52,20 +52,20 @@ export const createReservation = async ( payload: { partySize: number } ) => { const res = await UserApi.post( - `/reservations/create/redis/${storeId}`, + `v1/users/me/waitings/${storeId}`, payload ); return res.data; }; export const getMyReservations = async () => { - const res = await UserApi.get("/reservations/my/waitings"); + const res = await UserApi.get("/v1/users/me/waitings"); return res.data; }; // 북마크 조회 export const getBookmark = async (): Promise => { - const res = await UserApi.get("/bookmarks"); + const res = await UserApi.get("/v1/users/me/bookmarks"); return res.data; }; @@ -74,7 +74,7 @@ export const createBookmark = async ( storeId: number | undefined, signal: AbortSignal ) => { - await UserApi.post(`/bookmarks/${storeId}`, null, { signal }); + await UserApi.post(`/v1/users/me/bookmarks/${storeId}`, null, { signal }); }; // 북마크 삭제 @@ -82,6 +82,6 @@ export const deleteBookmark = async ( storeId: number | undefined, signal: AbortSignal ) => { - const res = await UserApi.delete(`/bookmarks/${storeId}`, { signal }); + const res = await UserApi.delete(`/v1/users/me/bookmarks/${storeId}`, { signal }); return res.data; }; diff --git a/apps/nowait-user/src/hooks/useInfiniteStores.ts b/apps/nowait-user/src/hooks/useInfiniteStores.ts index f1c4ad50..71477143 100644 --- a/apps/nowait-user/src/hooks/useInfiniteStores.ts +++ b/apps/nowait-user/src/hooks/useInfiniteStores.ts @@ -45,7 +45,7 @@ const fetchStores = async ({ try { // UserApi 사용으로 헤더 설정 자동화 (인터셉터에서 최신 토큰 처리) const response = await UserApi.get( - "/v1/stores/all-stores", + "/v1/stores", { params: { page: pageParam, diff --git a/apps/nowait-user/src/hooks/useMyWaitingList.ts b/apps/nowait-user/src/hooks/useMyWaitingList.ts index 26c71d09..7b7dd176 100644 --- a/apps/nowait-user/src/hooks/useMyWaitingList.ts +++ b/apps/nowait-user/src/hooks/useMyWaitingList.ts @@ -29,7 +29,7 @@ interface MyWaitingResponse { const fetchMyWaitingList = async (): Promise => { try { const response = await UserApi.get( - "/reservations/my/waitings" + "/v1/users/me/waitings" ); console.log("내 대기 목록 서버 응답:", response.data); diff --git a/apps/nowait-user/src/hooks/useWaitingStores.ts b/apps/nowait-user/src/hooks/useWaitingStores.ts index 01c4ef96..98e105c0 100644 --- a/apps/nowait-user/src/hooks/useWaitingStores.ts +++ b/apps/nowait-user/src/hooks/useWaitingStores.ts @@ -26,7 +26,7 @@ const fetchWaitingStores = async ( ): Promise => { try { const response = await UserApi.get( - "/v1/stores/waiting-list", + "/v1/stores/waiting-count", { params: { order,