diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-19 07:51:27 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-19 07:51:27 +0000 |
| commit | 9ecdfb23fe3df6a5df86782385002c562dfc1198 (patch) | |
| tree | 4188cb7e6bf2c862d9c86a59d79946bd41217227 /app/api/stage-submissions/sync | |
| parent | b67861fbb424c7ad47ad1538f75e2945bd8890c5 (diff) | |
(대표님) rfq 히스토리, swp 등
Diffstat (limited to 'app/api/stage-submissions/sync')
| -rw-r--r-- | app/api/stage-submissions/sync/route.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/api/stage-submissions/sync/route.ts b/app/api/stage-submissions/sync/route.ts new file mode 100644 index 00000000..ed9d30ce --- /dev/null +++ b/app/api/stage-submissions/sync/route.ts @@ -0,0 +1,35 @@ +// app/api/stage-submissions/sync/route.ts +import { ShiBuyerSystemAPI } from "@/lib/vendor-document-list/plant/shi-buyer-system-api" +import { NextRequest, NextResponse } from "next/server" + +export async function POST(req: NextRequest) { + try { + const body = await req.json() + const { submissionIds } = body + + if (!submissionIds || !Array.isArray(submissionIds) || submissionIds.length === 0) { + return NextResponse.json( + { error: "제출 ID 목록이 필요합니다." }, + { status: 400 } + ) + } + + const api = new ShiBuyerSystemAPI() + const results = await api.syncSubmissionsToSHI(submissionIds) + + return NextResponse.json({ + success: true, + message: `${results.successCount}/${results.totalCount}개 제출 건이 동기화되었습니다.`, + results + }) + } catch (error) { + console.error("Sync API Error:", error) + return NextResponse.json( + { + success: false, + error: error instanceof Error ? error.message : "동기화 실패" + }, + { status: 500 } + ) + } +}
\ No newline at end of file |
