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
4 changes: 2 additions & 2 deletions apps/nowait-user/src/api/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface MenuServerResponse {
export const getStoreMenus = async (publicCode: string) => {
try {
const res = await axios.get<AllMenuServerResponse>(
`${API_URI}/v1/menus/all-menus/stores/${publicCode}`
`${API_URI}/v1/stores/${publicCode}/menus`
);
if (res?.data.success) return res.data;
} catch (error) {
Expand All @@ -36,6 +36,6 @@ export const getStoreMenu = async (
publicCode: string,
menuId: number
): Promise<MenuServerResponse> => {
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;
};
7 changes: 4 additions & 3 deletions apps/nowait-user/src/api/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -20,7 +21,7 @@ export const createOrder = async (
payload: OrderType
): Promise<CreateOrderServerResponse> => {
const res = await api.post(
`/orders/create/${publicCode}/${tableId}`,
`v1/stores/${publicCode}/tables/${tableId}/orders`,
payload
);
return res.data;
Expand All @@ -31,15 +32,15 @@ export const getOrderDetails = async (
publicCode: string,
tableId: number
): Promise<OrderDetailsServerResponse> => {
const res = await api.get(`/orders/items/${publicCode}/${tableId}`);
const res = await api.get(`v1/stores/${publicCode}/tables/${tableId}/orders`);
return res.data;
};

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

// 모든 주점 정보 가져오기
export const getAllStores = async () => {
const response = await UserApi.get<ServerResponse>("/v1/stores/all-stores", {
const response = await UserApi.get<ServerResponse>("/v1/stores", {
params: {
page: 0,
size: 50,
Expand All @@ -27,7 +27,7 @@ export const getAllStores = async () => {
export const getInfiniteAllStores = async (
pageParam: number
): Promise<{ storePageReadResponses: StoreType[]; hasNext: boolean }> => {
const response = await UserApi.get<ServerResponse>("/v1/stores/all-stores", {
const response = await UserApi.get<ServerResponse>("/v1/stores", {
params: {
page: pageParam,
size: 5,
Expand All @@ -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<BookmarkResponse> => {
const res = await UserApi.get("/bookmarks");
const res = await UserApi.get("/v1/users/me/bookmarks");
return res.data;
};

Expand All @@ -74,14 +74,14 @@ 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 });
};

// 북마크 삭제
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;
};
2 changes: 1 addition & 1 deletion apps/nowait-user/src/hooks/useInfiniteStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const fetchStores = async ({
try {
// UserApi 사용으로 헤더 설정 자동화 (인터셉터에서 최신 토큰 처리)
const response = await UserApi.get<ServerResponse>(
"/v1/stores/all-stores",
"/v1/stores",
{
params: {
page: pageParam,
Expand Down
2 changes: 1 addition & 1 deletion apps/nowait-user/src/hooks/useMyWaitingList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface MyWaitingResponse {
const fetchMyWaitingList = async (): Promise<MyWaitingStore[]> => {
try {
const response = await UserApi.get<MyWaitingResponse>(
"/reservations/my/waitings"
"/v1/users/me/waitings"
);

console.log("내 대기 목록 서버 응답:", response.data);
Expand Down
2 changes: 1 addition & 1 deletion apps/nowait-user/src/hooks/useWaitingStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const fetchWaitingStores = async (
): Promise<WaitingStore[]> => {
try {
const response = await UserApi.get<WaitingStoresResponse>(
"/v1/stores/waiting-list",
"/v1/stores/waiting-count",
{
params: {
order,
Expand Down