diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-05-28 00:17:56 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-05-28 00:17:56 +0000 |
| commit | 9e280704988fdeffa05c1d8cbb731722f666c6af (patch) | |
| tree | bbf57b3c882502dc7afd2ff770d95aca69fca0d9 /app/api/sync/batches/route.ts | |
| parent | 44356f1b203da5169db42950a42a8146f612c674 (diff) | |
(대표님) 앱 라우터 api 파트 커밋
Diffstat (limited to 'app/api/sync/batches/route.ts')
| -rw-r--r-- | app/api/sync/batches/route.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/api/sync/batches/route.ts b/app/api/sync/batches/route.ts new file mode 100644 index 00000000..a1ef8d26 --- /dev/null +++ b/app/api/sync/batches/route.ts @@ -0,0 +1,32 @@ +import { syncService } from "@/lib/vendor-document-list/sync-service" +import { NextRequest, NextResponse } from "next/server" + +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const contractId = searchParams.get('contractId') + const targetSystem = searchParams.get('targetSystem') || 'SHI' + const limit = parseInt(searchParams.get('limit') || '10') + + if (!contractId) { + return NextResponse.json( + { error: 'Contract ID is required' }, + { status: 400 } + ) + } + + const batches = await syncService.getRecentSyncBatches( + parseInt(contractId), + targetSystem, + limit + ) + + return NextResponse.json(batches) + } catch (error) { + console.error('Failed to get sync batches:', error) + return NextResponse.json( + { error: 'Failed to get sync batches' }, + { status: 500 } + ) + } +}
\ No newline at end of file |
