diff options
Diffstat (limited to 'lib/techsales-rfq/approval-handlers.ts')
| -rw-r--r-- | lib/techsales-rfq/approval-handlers.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/techsales-rfq/approval-handlers.ts b/lib/techsales-rfq/approval-handlers.ts index 0d4629e4..979096b7 100644 --- a/lib/techsales-rfq/approval-handlers.ts +++ b/lib/techsales-rfq/approval-handlers.ts @@ -54,10 +54,14 @@ export async function sendTechSalesRfqWithApprovalInternal(payload: { for (const attachment of drmAttachments) { try { - // DRM 파일 다운로드 - const fileResponse = await fetch(attachment.filePath); + // DRM 파일 다운로드 - 상대 경로를 절대 URL로 변환 + let fileUrl = attachment.filePath; + const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || process.env.NEXT_PUBLIC_URL; + fileUrl = `${baseUrl}${fileUrl}`; + console.log(`[TechSales RFQ Approval Handler] Fetching file from: ${fileUrl}`); + const fileResponse = await fetch(fileUrl); if (!fileResponse.ok) { - console.error(`[TechSales RFQ Approval Handler] Failed to fetch file: ${attachment.filePath}`); + console.error(`[TechSales RFQ Approval Handler] Failed to fetch file: ${fileUrl} (status: ${fileResponse.status})`); continue; } @@ -103,6 +107,7 @@ export async function sendTechSalesRfqWithApprovalInternal(payload: { rfqId: payload.rfqId, vendorIds: payload.vendorIds, selectedContacts: payload.selectedContacts, + currentUser: payload.currentUser, }); console.log('[TechSales RFQ Approval Handler] ✅ RFQ sent successfully after DRM decryption'); @@ -224,6 +229,7 @@ export async function resendTechSalesRfqWithDrmInternal(payload: { const sendResult = await sendTechSalesRfqToVendors({ rfqId: payload.rfqId, vendorIds: vendorIds, + currentUser: payload.currentUser, }); console.log('[TechSales RFQ Resend Handler] ✅ RFQ resent successfully after DRM decryption'); |
