summaryrefslogtreecommitdiff
path: root/lib/vendor-document-list/ship/send-to-shi-button.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-08-14 11:54:47 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-08-14 11:54:47 +0000
commit969c25b56f6d29d7ffa4bc2ce04c5fb4e5846b34 (patch)
tree551d335e850e6163792ded0e7a75fa41d96d612a /lib/vendor-document-list/ship/send-to-shi-button.tsx
parentdd20ba9785cdbd3d61f6b014d003d3bd9646ad13 (diff)
(대표님) 정규벤더등록, 벤더문서관리, 벤더데이터입력, 첨부파일관리
Diffstat (limited to 'lib/vendor-document-list/ship/send-to-shi-button.tsx')
-rw-r--r--lib/vendor-document-list/ship/send-to-shi-button.tsx18
1 files changed, 4 insertions, 14 deletions
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<number | null>(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 () => {