summaryrefslogtreecommitdiff
path: root/lib/vendor-investigation/service.ts
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-08-13 11:05:09 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-08-13 11:05:09 +0000
commit33be47506f0aa62b969d82521580a29e95080268 (patch)
tree6b7e232f2d78ef8775944ea085a36b3ccbce7d95 /lib/vendor-investigation/service.ts
parent2ac95090157c355ea1bd0b8eb1e1e5e2bd56faf4 (diff)
(대표님) 입찰, 법무검토, EDP 변경사항 대응, dolce 개선, form-data 개선, 정규업체 등록관리 추가
(최겸) pq 미사용 컴포넌트 및 페이지 제거, 파일 라우트에 pq 적용
Diffstat (limited to 'lib/vendor-investigation/service.ts')
-rw-r--r--lib/vendor-investigation/service.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/vendor-investigation/service.ts b/lib/vendor-investigation/service.ts
index 81eabc37..f0eb411e 100644
--- a/lib/vendor-investigation/service.ts
+++ b/lib/vendor-investigation/service.ts
@@ -3,7 +3,7 @@
import { items, vendorInvestigationAttachments, vendorInvestigations, vendorInvestigationsView, vendorPossibleItems, vendors } from "@/db/schema/"
import { GetVendorsInvestigationSchema, updateVendorInvestigationSchema } from "./validations"
import { asc, desc, ilike, inArray, and, or, gte, lte, eq, isNull, count } from "drizzle-orm";
-import { revalidateTag, unstable_noStore } from "next/cache";
+import { revalidateTag, unstable_noStore, revalidatePath } from "next/cache";
import { filterColumns } from "@/lib/filter-columns";
import { unstable_cache } from "@/lib/unstable-cache";
import { getErrorMessage } from "@/lib/handle-error";
@@ -293,6 +293,10 @@ export async function updateVendorInvestigationAction(formData: FormData) {
if (parsed.investigationNotes !== undefined) {
updateData.investigationNotes = parsed.investigationNotes
}
+ // evaluationType이 null이 아니고, status가 계획중(PLANNED) 이라면, 진행중(IN_PROGRESS)으로 바꿔주는 로직 추가
+ if (parsed.evaluationResult !== null && parsed.investigationStatus === "PLANNED") {
+ updateData.investigationStatus = "IN_PROGRESS";
+ }
// 5) vendor_investigations 테이블 업데이트
await db
@@ -302,6 +306,9 @@ export async function updateVendorInvestigationAction(formData: FormData) {
// 6) 캐시 무효화
revalidateTag("vendors-in-investigation")
+ revalidateTag("pq-submissions")
+ revalidateTag("vendor-pq-submissions")
+ revalidatePath("/evcp/pq_new")
return { data: "OK", error: null }
} catch (err: unknown) {