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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-6b67494872-10c0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions apps/nowait-admin/src/components/MobileAdminNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,21 @@ const MobileAdminNav = ({
<div className="flex flex-col justify-between h-full">
<ul className="flex flex-col gap-2">
{menuItems.map(({ label, icon, activeIcon, path }) => {
const isActive = pathname === path;
//주문의 경우 클릭시 경로에 storeId가 붙기 때문에 추가 검증
if (label === "주문") {
path = `/admin/orders/${storeId}`;
}
const isActive = pathname === path;
Comment on lines 59 to +64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Avoid mutating the destructured path variable.

Reassigning the path variable that comes from destructuring is confusing and violates clean code principles. Instead, compute the actual path in a separate variable to maintain clarity.

Apply this diff to use a separate variable:

         {menuItems.map(({ label, icon, activeIcon, path }) => {
-          //주문의 경우 클릭시 경로에 storeId가 붙기 때문에 추가 검증
+          // 주문의 경우 클릭시 경로에 storeId가 붙기 때문에 추가 검증
+          const actualPath = label === "주문" ? `/admin/orders/${storeId}` : path;
-          if (label === "주문") {
-            path = `/admin/orders/${storeId}`;
-          }
-          const isActive = pathname === path;
+          const isActive = pathname === actualPath;
           return (
             <li
               key={label}
               className={`flex items-center gap-3 px-3 py-2 rounded-md text-title-18-semibold ${
                 isActive ? "bg-[#f5f5f5] text-black" : "text-black-50"
               }`}
-              onClick={() => {
-                navigate(path);
-                onClose();
-              }}
+              onClick={() => {
+                navigate(actualPath);
+                onClose();
+              }}
             >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{menuItems.map(({ label, icon, activeIcon, path }) => {
const isActive = pathname === path;
//주문의 경우 클릭시 경로에 storeId가 붙기 때문에 추가 검증
if (label === "주문") {
path = `/admin/orders/${storeId}`;
}
const isActive = pathname === path;
{menuItems.map(({ label, icon, activeIcon, path }) => {
// 주문의 경우 클릭시 경로에 storeId가 붙기 때문에 추가 검증
const actualPath = label === "주문" ? `/admin/orders/${storeId}` : path;
const isActive = pathname === actualPath;
return (
<li
key={label}
className={`flex items-center gap-3 px-3 py-2 rounded-md text-title-18-semibold ${
isActive ? "bg-[#f5f5f5] text-black" : "text-black-50"
}`}
onClick={() => {
navigate(actualPath);
onClose();
}}
>
🤖 Prompt for AI Agents
In apps/nowait-admin/src/components/MobileAdminNav.tsx around lines 59 to 64,
the code mutates the destructured path variable for the "주문" menu item which is
confusing; instead compute a new variable (e.g., resolvedPath or itemPath) that
sets `/admin/orders/${storeId}` when label === "주문" otherwise uses the original
path, then use that new variable for active-checking and any navigation so the
destructured props remain immutable and intent is clear.

return (
<li
key={label}
className={`flex items-center gap-3 px-3 py-2 rounded-md text-title-18-semibold ${
isActive ? "bg-[#f5f5f5] text-black" : "text-black-50"
}`}
onClick={() => navigate(path)}
onClick={() => {
navigate(path);
onClose();
}}
>
{isActive ? (
<img src={activeIcon} alt={label} className="w-5 h-5" />
Expand Down
42 changes: 42 additions & 0 deletions apps/nowait-admin/src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,45 @@ input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
display: none;
}

input[type="range"] {
-webkit-appearance: none;
appearance: none;

width: 100%;
height: 6px;
border-radius: 4px;
outline: none;

/* 왼쪽 = #222 / 오른쪽 = 연회색 */
background: linear-gradient(to right, #222 var(--value, 0%), #e5e7eb 0%);
}

input[type="range"]::-webkit-slider-runnable-track {
background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 14px;
height: 14px;
background: #222;
border-radius: 50%;
cursor: pointer;
margin-top: -1px;
}

/* Firefox */
/* input[type="range"]::-moz-range-thumb {
width: 14px;
height: 14px;
background: #3b82f6;
border-radius: 50%;
cursor: pointer;
}
input[type="range"]::-moz-range-track {
background: #d1d5db;
height: 6px;
border-radius: 4px;
} */
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import PreviewModal from "./Modal/PreviewModal";
import { useDeleteBannerImage } from "../../../hooks/booth/menu/useDeleteBannerImage";
import { useRemoveEmoji } from "../../../hooks/useRemoveEmoji";
import ImageCropModal from "./Modal/ImageCropModal";
import { useWindowWidth } from "../../../hooks/useWindowWidth";

const BoothSection = ({
location,
Expand Down Expand Up @@ -69,6 +70,7 @@ const BoothSection = ({
isMobile: boolean;
}) => {
const [showPreview, setShowPreview] = useState(false);
const width = useWindowWidth();
const { mutate: deleteBannerImage } = useDeleteBannerImage();
const { removeEmojiAll } = useRemoveEmoji();
const [cropSpec, setCropSpec] = useState<{
Expand Down Expand Up @@ -406,7 +408,7 @@ const BoothSection = ({
setNotice={setBoothNotice}
/>

{cropSpec && (
{cropSpec && width > 1279 && (
<ImageCropModal
file={cropSpec.file}
aspect={cropSpec.aspect}
Expand All @@ -416,11 +418,7 @@ const BoothSection = ({
quality={0.95}
onDone={handleCropDone}
onClose={() => setCropSpec(null)}
title={
cropSpec.target === "profile"
? "프로필 이미지 1:1 자르기"
: "배너 이미지 375:246 자르기"
}
title={"이미지 편집하기"}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export default function ImageCropModal({

return (
<div className="fixed inset-0 z-[1000] flex items-center justify-center bg-black/60">
<div className="w-full max-w-[520px] rounded-2xl bg-white p-4">
<div className="w-full max-w-[520px] rounded-2xl bg-white py-4 px-5">
<div className="mb-3 text-16-semibold">{title}</div>

<div className="relative h-[360px] w-full overflow-hidden rounded-xl bg-black">
<div className="relative h-[360px] w-full overflow-hidden rounded-xl bg-black cropper-wrapper">
<Cropper
image={url}
crop={crop}
Expand All @@ -95,7 +95,12 @@ export default function ImageCropModal({
max={6}
step={0.01}
value={zoom}
onChange={(e) => setZoom(Number(e.target.value))}
onChange={(e) => {
const v = Number(e.target.value);
setZoom(v);
const percent = ((v - 1) / (6 - 1)) * 100;
e.target.style.setProperty("--value", `${percent}%`);
}}
/>
</div>

Expand Down
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`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Missing leading slash in URL path.

The path v1/stores/${publicCode}/tables/${tableId}/orders is missing a leading slash. When combined with the baseURL, this will create a malformed URL. Always include a leading slash when using axios instances with baseURL.

🔎 Proposed fix
-    `v1/stores/${publicCode}/tables/${tableId}/orders`,
+    `/v1/stores/${publicCode}/tables/${tableId}/orders`,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`v1/stores/${publicCode}/tables/${tableId}/orders`,
`/v1/stores/${publicCode}/tables/${tableId}/orders`,
🤖 Prompt for AI Agents
In apps/nowait-user/src/api/order.ts around line 24 the request path string is
missing a leading slash so concatenation with the axios instance baseURL
produces an incorrect URL; update the path to include a leading slash (e.g.
change `v1/...` to `/v1/...`) wherever this endpoint is used so axios resolves
the URL correctly.

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`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Missing leading slash in URL path.

The path v1/stores/${publicCode}/tables/${tableId}/orders is missing a leading slash. This will create a malformed URL when combined with the axios instance's baseURL.

🔎 Proposed fix
-  const res = await api.get(`v1/stores/${publicCode}/tables/${tableId}/orders`);
+  const res = await api.get(`/v1/stores/${publicCode}/tables/${tableId}/orders`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const res = await api.get(`v1/stores/${publicCode}/tables/${tableId}/orders`);
const res = await api.get(`/v1/stores/${publicCode}/tables/${tableId}/orders`);
🤖 Prompt for AI Agents
In apps/nowait-user/src/api/order.ts around line 35 the GET path lacks a leading
slash which can produce a malformed URL when concatenated with the axios
instance baseURL; update the request to use an absolute path by prefixing the
route with a leading slash (i.e. change to "/v1/stores/…/orders") so axios
correctly resolves the endpoint, and run a quick test to confirm the constructed
URL is valid.

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}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Missing leading slash in URL path.

The path v1/users/me/waitings/${storeId} is missing a leading slash. When used with UserApi (which likely has a configured baseURL), this will create a malformed URL and break reservation creation.

🔎 Proposed fix
-    `v1/users/me/waitings/${storeId}`,
+    `/v1/users/me/waitings/${storeId}`,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`v1/users/me/waitings/${storeId}`,
`/v1/users/me/waitings/${storeId}`,
🤖 Prompt for AI Agents
In apps/nowait-user/src/api/reservation.ts around line 55 the request path uses
`v1/users/me/waitings/${storeId}` which lacks a leading slash and will produce a
malformed URL when combined with the API client's baseURL; update the string to
include a leading slash (i.e. `/v1/users/me/waitings/${storeId}`) so the request
path is absolute and compose correctly with the configured baseURL.

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
Loading