summaryrefslogtreecommitdiff
path: root/lib/vendor-investigation
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-05 19:28:49 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-05 19:28:49 +0900
commite890fbae0c9c273b825ac808aa516de1f87fb218 (patch)
treec2b7bdacd22043a8b4781e9b4c6ea682468abd0f /lib/vendor-investigation
parent35e373fe29a4145d0692ee35ff9e6b0c887df0eb (diff)
(김준회) 실사의뢰 결재 오류 수정, 결재 캐시 백그라운드 컨텍스트에서 패스로 무효화 처리, pm2 ecosystem 설정 변경 (npm 레이어 로그 문제), git 줄바꿈 문제 2건 커밋으로 처리
Diffstat (limited to 'lib/vendor-investigation')
-rw-r--r--lib/vendor-investigation/handlers.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/vendor-investigation/handlers.ts b/lib/vendor-investigation/handlers.ts
index 3165df06..b7da952a 100644
--- a/lib/vendor-investigation/handlers.ts
+++ b/lib/vendor-investigation/handlers.ts
@@ -37,18 +37,34 @@ export async function requestPQInvestigationInternal(payload: {
throw new Error(errorMessage);
}
+ // ✅ Date 문자열을 Date 객체로 변환
+ // DB의 jsonb에서 읽을 때 Date 객체가 ISO 문자열로 변환되어 있음
+ const forecastedAt = typeof payload.forecastedAt === 'string'
+ ? new Date(payload.forecastedAt)
+ : payload.forecastedAt;
+
+ debugLog('[PQInvestigationHandler] Date 변환 완료', {
+ originalType: typeof payload.forecastedAt,
+ convertedType: typeof forecastedAt,
+ forecastedAt: forecastedAt.toISOString(),
+ });
+
try {
// 기존 PQ 서비스 함수 사용 (DB 트랜잭션 포함)
const { requestInvestigationAction } = await import('@/lib/pq/service');
+ debugLog('[PQInvestigationHandler] requestInvestigationAction 호출');
const result = await requestInvestigationAction(
payload.pqSubmissionIds,
{ id: payload.currentUserId, epId: null, email: undefined }, // ✅ 실제 사용자 ID 전달
{
qmManagerId: payload.qmManagerId,
- forecastedAt: payload.forecastedAt,
+ forecastedAt: forecastedAt, // ✅ Date 객체 전달
investigationAddress: payload.investigationAddress,
investigationNotes: payload.investigationNotes,
+ },
+ {
+ skipRevalidation: true, // ✅ 폴링 컨텍스트에서는 revalidation 건너뛰기
}
);
@@ -133,9 +149,13 @@ export async function reRequestPQInvestigationInternal(payload: {
// 기존 PQ 서비스 함수 사용
const { reRequestInvestigationAction } = await import('@/lib/pq/service');
+ debugLog('[PQReRequestHandler] reRequestInvestigationAction 호출');
const result = await reRequestInvestigationAction(
payload.investigationIds,
- { id: payload.currentUserId } // ✅ 실제 사용자 ID 전달
+ { id: payload.currentUserId }, // ✅ 실제 사용자 ID 전달
+ {
+ skipRevalidation: true, // ✅ 폴링 컨텍스트에서는 revalidation 건너뛰기
+ }
);
if (!result.success) {