diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
| commit | 8b23b471638a155fd1bfa3a8c853b26d9315b272 (patch) | |
| tree | 47353e9dd342011cb2f1dcd24b09661707a8421b /lib/vendor-document-list/plant/upload/table.tsx | |
| parent | d62368d2b68d73da895977e60a18f9b1286b0545 (diff) | |
(대표님) 권한관리, 문서업로드, rfq첨부, SWP문서룰 등
(최겸) 입찰
Diffstat (limited to 'lib/vendor-document-list/plant/upload/table.tsx')
| -rw-r--r-- | lib/vendor-document-list/plant/upload/table.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/vendor-document-list/plant/upload/table.tsx b/lib/vendor-document-list/plant/upload/table.tsx index 92507900..84b04092 100644 --- a/lib/vendor-document-list/plant/upload/table.tsx +++ b/lib/vendor-document-list/plant/upload/table.tsx @@ -20,6 +20,7 @@ import { ProjectFilter } from "./components/project-filter" import { SingleUploadDialog } from "./components/single-upload-dialog" import { HistoryDialog } from "./components/history-dialog" import { ViewSubmissionDialog } from "./components/view-submission-dialog" +import { toast } from "sonner" interface StageSubmissionsTableProps { promises: Promise<[ @@ -159,6 +160,30 @@ export function StageSubmissionsTable({ promises, selectedProjectId }: StageSubm columnResizeMode: "onEnd", }) + + React.useEffect(() => { + if (!rowAction) return; + + const { type, row } = rowAction; + + if (type === "downloadCover") { + // 2) 서버에서 생성 후 다운로드 (예: API 호출) + (async () => { + try { + const res = await fetch(`/api/stages/${row.original.stageId}/cover`, { method: "POST" }); + if (!res.ok) throw new Error("failed"); + const { fileUrl } = await res.json(); // 서버 응답: { fileUrl: string } + window.open(fileUrl, "_blank", "noopener,noreferrer"); + } catch (e) { + toast.error("커버 페이지 생성에 실패했습니다."); + console.error(e); + } finally { + setRowAction(null); + } + })(); + } + }, [rowAction, setRowAction]); + return ( <> <DataTable table={table}> |
