From 91ab88a359d944638ea1e2dc032de399a0757f4e Mon Sep 17 00:00:00 2001 From: chpark Date: Wed, 13 May 2026 00:49:08 +0900 Subject: [PATCH] =?UTF-8?q?fix(orders):=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EA=B3=B5=EC=9C=A0=20=EB=B2=84=ED=8A=BC=EC=9D=84=20admin=20?= =?UTF-8?q?=EB=A7=8C=20=EB=85=B8=EC=B6=9C=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=B4=EC=88=98=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존: user.role === "USER" 일 때 숨김 → 거래처라도 role 필드 비어있으면 노출되는 버그 변경: user.isAdmin === true || role === "ADMIN" 일 때만 노출 → 그 외는 모두 숨김 admin 계정만 거래명세표 이미지 공유 가능. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/(main)/m/orders/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/(main)/m/orders/page.tsx b/src/app/(main)/m/orders/page.tsx index 1639b68..d708bc2 100644 --- a/src/app/(main)/m/orders/page.tsx +++ b/src/app/(main)/m/orders/page.tsx @@ -240,7 +240,8 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: { }; const user = useAuthStore((s) => s.user); - const isUserRole = user?.role === "USER"; + // 이미지 공유 버튼은 관리자(admin) 한해서만 노출. 일반 사용자(거래처) 화면에서는 숨김. + const showImageShare = user?.isAdmin === true || user?.role === "ADMIN"; const captureAndShare = async () => { if (!ref.current) return; @@ -258,7 +259,7 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: {
e.stopPropagation()}>
- {!isUserRole && ( + {showImageShare && (