summaryrefslogtreecommitdiff
path: root/lib/swp/actions.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-10-29 15:59:04 +0900
committerjoonhoekim <26rote@gmail.com>2025-10-29 15:59:04 +0900
commit2ecdac866c19abea0b5389708fcdf5b3889c969a (patch)
treee02a02cfa0890691fb28a7df3a96ef495b3d4b79 /lib/swp/actions.ts
parent2fc9e5492e220041ba322d9a1479feb7803228cf (diff)
(김준회) SWP 파일 업로드 취소 기능 추가, 업로드 파일명 검증로직에서 파일명 비필수로 변경
Diffstat (limited to 'lib/swp/actions.ts')
-rw-r--r--lib/swp/actions.ts60
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/swp/actions.ts b/lib/swp/actions.ts
index a7b4d3a3..eea8c9c2 100644
--- a/lib/swp/actions.ts
+++ b/lib/swp/actions.ts
@@ -474,3 +474,63 @@ function getMimeType(fileName: string): string {
return mimeTypes[ext] || "application/octet-stream";
}
+
+// ============================================================================
+// 서버 액션: 벤더 업로드 파일 목록 조회
+// ============================================================================
+
+export async function fetchVendorUploadedFiles(projNo: string, vndrCd: string) {
+ try {
+ debugLog(`[fetchVendorUploadedFiles] 조회 시작`, { projNo, vndrCd });
+
+ // fetchGetExternalInboxList 호출
+ const { fetchGetExternalInboxList } = await import("./api-client");
+ const files = await fetchGetExternalInboxList({
+ projNo,
+ vndrCd,
+ });
+
+ debugLog(`[fetchVendorUploadedFiles] 조회 완료`, {
+ fileCount: files.length
+ });
+
+ return files;
+ } catch (error) {
+ debugError(`[fetchVendorUploadedFiles] 조회 실패`, { error });
+ throw new Error(
+ error instanceof Error ? error.message : "업로드 파일 목록 조회 실패"
+ );
+ }
+}
+
+// ============================================================================
+// 서버 액션: 벤더 업로드 파일 취소
+// ============================================================================
+
+export interface CancelUploadedFileParams {
+ boxSeq: string;
+ actvSeq: string;
+ userId: string;
+}
+
+export async function cancelVendorUploadedFile(params: CancelUploadedFileParams) {
+ try {
+ debugLog(`[cancelVendorUploadedFile] 취소 시작`, params);
+
+ const { callSaveInBoxListCancelStatus } = await import("./api-client");
+ await callSaveInBoxListCancelStatus({
+ boxSeq: params.boxSeq,
+ actvSeq: params.actvSeq,
+ chgr: `evcp${params.userId}`,
+ });
+
+ debugSuccess(`[cancelVendorUploadedFile] 취소 완료`, params);
+
+ return { success: true };
+ } catch (error) {
+ debugError(`[cancelVendorUploadedFile] 취소 실패`, { error });
+ throw new Error(
+ error instanceof Error ? error.message : "파일 취소 실패"
+ );
+ }
+}