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: 3 additions & 1 deletion apps/nowait-admin/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="preload" as="font" type="font/woff2" href="/fonts/pretendard/PretendardVariable.woff2" crossorigin />
<link rel="icon" type="image/svg+xml" href="/favicon_admin.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NOWAIT Admin</title>
Expand All @@ -11,3 +12,4 @@
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

Binary file not shown.
15 changes: 15 additions & 0 deletions apps/nowait-admin/public/fonts/pretendard/pretendardvariable.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@font-face {
font-family: "Pretendard Variable";
font-weight: 100 900;
font-style: normal;
font-display: swap;
src: url("../pretendard/PretendardVariable.woff2") format("woff2");
}

/* @font-face {
font-family: "Pretendard Variable";
font-weight: 100 900;
font-style: italic;
font-display: swap;
src: url("/fonts/pretendard/PretendardVariable-Italic.woff2") format("woff2");
} */
20 changes: 14 additions & 6 deletions apps/nowait-admin/src/pages/AdminOrders/AdminOrders.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useRef, useEffect } from "react";
import { useState, useRef, useEffect, useMemo } from "react";
import { useLocation, useNavigate, useParams } from "react-router";
import { PaymentCard, CookCard, CookedCard } from "./OrderCard";
import { DetailCard } from "./DetailCard";
Expand Down Expand Up @@ -67,11 +67,19 @@ const AdminOrders = () => {
};

// 상태별 데이터 필터링
const paymentWaitingData = orders.filter(
(order) => order.status === "WAITING_FOR_PAYMENT"
);
const cookingData = orders.filter((order) => order.status === "COOKING");
const cookedData = orders.filter((order) => order.status === "COOKED");
const { paymentWaitingData, cookingData, cookedData } = useMemo(() => {
const waiting: Order[] = [];
const cooking: Order[] = [];
const cooked: Order[] = [];

orders.forEach((order) => {
if (order.status === "WAITING_FOR_PAYMENT") waiting.push(order);
else if (order.status === "COOKING") cooking.push(order);
else if (order.status === "COOKED") cooked.push(order);
});

return { paymentWaitingData: waiting, cookingData: cooking, cookedData: cooked };
}, [orders]);

// 새로고침 핸들러
const handleRefresh = () => {
Expand Down
4 changes: 3 additions & 1 deletion apps/nowait-user/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="preload" as="font" type="font/woff2" href="/fonts/pretendard/PretendardVariable.woff2" crossorigin />
<link rel="icon" type="image/png" href="/favicon-user.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NOWAIT</title>
Expand All @@ -16,3 +17,4 @@
></script>
</body>
</html>

Binary file not shown.
15 changes: 15 additions & 0 deletions apps/nowait-user/public/fonts/pretendard/pretendardvariable.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@font-face {
font-family: "Pretendard Variable";
font-weight: 100 900;
font-style: normal;
font-display: swap;
src: url("../pretendard/PretendardVariable.woff2") format("woff2");
}

/* @font-face {
font-family: "Pretendard Variable";
font-weight: 100 900;
font-style: italic;
font-display: swap;
src: url("/fonts/pretendard/PretendardVariable-Italic.woff2") format("woff2");
} */
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 @@ -21,7 +21,7 @@ interface MenuServerResponse {
export const getStoreMenus = async (publicCode: string) => {
try {
const res = await UserApi.get<AllMenuServerResponse>(
`/stores/${publicCode}/menus`
`/v1/stores/${publicCode}/menus`
);
if (res?.data.success) return res.data;
} catch (error) {
Expand All @@ -34,6 +34,6 @@ export const getStoreMenu = async (
publicCode: string,
menuId: number
): Promise<MenuServerResponse> => {
const res = await UserApi.get(`/stores/${publicCode}/menus/${menuId}`);
const res = await UserApi.get(`/v1/stores/${publicCode}/menus/${menuId}`);
return res.data;
};
6 changes: 3 additions & 3 deletions apps/nowait-user/src/api/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const createOrder = async (
payload: OrderType
): Promise<CreateOrderServerResponse> => {
const res = await UserApi.post(
`/stores/${publicCode}/tables/${tableId}/orders`,
`/v1/stores/${publicCode}/tables/${tableId}/orders`,
payload
);
return res.data;
Expand All @@ -24,15 +24,15 @@ export const getOrderDetails = async (
publicCode: string,
tableId: number
): Promise<OrderDetailsServerResponse> => {
const res = await UserApi.get(`/stores/${publicCode}/tables/${tableId}/orders`);
const res = await UserApi.get(`/v1/stores/${publicCode}/tables/${tableId}/orders`);
return res.data;
};

//주점 QR, 계좌번호 조회
export const getStorePayments = async (publicCode: string) => {
try {
const res = await UserApi.get<StorePaymentsResponse>(
`/stores/${publicCode}/payments`
`/v1/stores/${publicCode}/payments`
);
return res.data;
} catch (error) {
Expand Down
16 changes: 8 additions & 8 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>("/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>("/stores", {
const response = await UserApi.get<ServerResponse>("/v1/stores", {
params: {
page: pageParam,
size: 5,
Expand All @@ -39,7 +39,7 @@ export const getInfiniteAllStores = async (
// 주점 상세 정보 가져오기
export const getStore = async (publicCode: string) => {
try {
const res = await UserApi.get<StoreResponse>(`/stores/${publicCode}`);
const res = await UserApi.get<StoreResponse>(`/v1/stores/${publicCode}`);
return res.data;
} catch (error) {
console.log(error);
Expand All @@ -51,18 +51,18 @@ export const createReservation = async (
storeId: number,
payload: { partySize: number }
) => {
const res = await UserApi.post(`/users/me/waitings/${storeId}`, payload);
const res = await UserApi.post(`/v1/users/me/waitings/${storeId}`, payload);
return res.data;
};

export const getMyReservations = async () => {
const res = await UserApi.get("/users/me/waitings");
const res = await UserApi.get("/v1/users/me/waitings");
return res.data;
};

// 북마크 조회
export const getBookmark = async (): Promise<BookmarkResponse> => {
const res = await UserApi.get("/users/me/bookmarks");
const res = await UserApi.get("/v1/users/me/bookmarks");
return res.data;
};

Expand All @@ -71,15 +71,15 @@ export const createBookmark = async (
storeId: number | undefined,
signal: AbortSignal
) => {
await UserApi.post(`/users/me/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(`/users/me/bookmarks/${storeId}`, {
const res = await UserApi.delete(`/v1/users/me/bookmarks/${storeId}`, {
signal,
});
return res.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const useBooths = () => {
queryKey: ["storesMarkers"],
queryFn: getAllStores,
select: (data) => data?.response?.storePageReadResponses,
staleTime: 1000 * 60,
staleTime: 1000 * 60 * 5, // 5분
gcTime: 1000 * 60 * 10, // 10분
refetchOnWindowFocus: false,
});

// 부스 + 마커 좌표
Expand Down
Loading