From 969c25b56f6d29d7ffa4bc2ce04c5fb4e5846b34 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 14 Aug 2025 11:54:47 +0000 Subject: (대표님) 정규벤더등록, 벤더문서관리, 벤더데이터입력, 첨부파일관리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vendor-document-list/ship/send-to-shi-button.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib/vendor-document-list/ship/send-to-shi-button.tsx') diff --git a/lib/vendor-document-list/ship/send-to-shi-button.tsx b/lib/vendor-document-list/ship/send-to-shi-button.tsx index 447b461b..87cc6ff5 100644 --- a/lib/vendor-document-list/ship/send-to-shi-button.tsx +++ b/lib/vendor-document-list/ship/send-to-shi-button.tsx @@ -28,6 +28,7 @@ import { useClientSyncStatus, useTriggerSync, syncUtils } from "@/hooks/use-sync import type { EnhancedDocument } from "@/types/enhanced-documents" import { useParams } from "next/navigation" import { useTranslation } from "@/i18n/client" +import { useSession } from "next-auth/react" interface SendToSHIButtonProps { documents?: EnhancedDocument[] @@ -43,6 +44,7 @@ export function SendToSHIButton({ const [isDialogOpen, setIsDialogOpen] = React.useState(false) const [syncProgress, setSyncProgress] = React.useState(0) const [currentSyncingContract, setCurrentSyncingContract] = React.useState(null) + const { data: session } = useSession(); const params = useParams() const lng = (params?.lng as string) || "ko" @@ -60,6 +62,8 @@ export function SendToSHIButton({ return uniqueIds.sort() }, [documents]) + const vendorId = session?.user.companyId + // ✅ 클라이언트 전용 Hook 사용 (서버 사이드 렌더링 호환) const { contractStatuses, totalStats, refetchAll } = useClientSyncStatus( documentsContractIds, @@ -68,20 +72,6 @@ export function SendToSHIButton({ const { triggerSync, isLoading: isSyncing, error: syncError } = useTriggerSync() - // 개발 환경에서 디버깅 정보 - React.useEffect(() => { - if (process.env.NODE_ENV === 'development') { - console.log('SendToSHIButton Debug Info:', { - documentsContractIds, - totalStats, - contractStatuses: contractStatuses.map(({ projectId, syncStatus, error }) => ({ - projectId, - pendingChanges: syncStatus?.pendingChanges, - hasError: !!error - })) - }) - } - }, [documentsContractIds, totalStats, contractStatuses]) // 동기화 실행 함수 const handleSync = async () => { -- cgit v1.2.3