From 0e9378a638b7c272920058110d7441f92d2eea8f Mon Sep 17 00:00:00 2001 From: chpark Date: Wed, 13 May 2026 00:26:26 +0900 Subject: [PATCH] =?UTF-8?q?feat(orders):=20=EC=82=AC=EC=9A=A9=EC=9E=90(USE?= =?UTF-8?q?R)=EC=9D=98=20=EB=82=B4=EC=B6=9C=EA=B3=A0=EC=9D=B4=EB=A0=A5?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=20=EB=B2=84=ED=8A=BC=20=EC=88=A8=EA=B9=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit m/orders 페이지의 거래명세표 DetailModal 에서 "이미지 공유" 버튼이 모든 사용자에게 노출되던 문제. useAuthStore 의 user.role === "USER" 이면 버튼 hide. ADMIN 은 그대로 표시. 엑셀 다운로드 버튼은 그대로 유지 (사용자가 자기 주문 명세는 엑셀로 받을 수 있음). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/(main)/m/orders/page.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/(main)/m/orders/page.tsx b/src/app/(main)/m/orders/page.tsx index 744099a..1639b68 100644 --- a/src/app/(main)/m/orders/page.tsx +++ b/src/app/(main)/m/orders/page.tsx @@ -6,6 +6,7 @@ import { Download, Image as ImageIcon, X, Eye, Trash2 } from "lucide-react"; import Swal from "sweetalert2"; import { downloadXlsx } from "@/lib/xlsx-export"; import { captureAndShare as captureAndShareLib } from "@/lib/capture-share"; +import { useAuthStore } from "@/store/auth-store"; interface Order { OBJID: string; @@ -238,6 +239,9 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: { else Swal.fire({ icon: "error", title: "삭제 실패", text: j.message }); }; + const user = useAuthStore((s) => s.user); + const isUserRole = user?.role === "USER"; + const captureAndShare = async () => { if (!ref.current) return; await captureAndShareLib({ @@ -254,10 +258,12 @@ function DetailModal({ order, items, supplier, onClose, onCancel, onReload }: {
e.stopPropagation()}>
- + {!isUserRole && ( + + )} 엑셀 다운로드