summaryrefslogtreecommitdiff
path: root/app/api/sync/status/route.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/api/sync/status/route.ts')
-rw-r--r--app/api/sync/status/route.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/api/sync/status/route.ts b/app/api/sync/status/route.ts
index 886c14df..b4b18577 100644
--- a/app/api/sync/status/route.ts
+++ b/app/api/sync/status/route.ts
@@ -33,22 +33,22 @@ function serializeForJSON(obj: any): any {
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url)
- const contractId = searchParams.get('contractId')
+ const projectId = searchParams.get('projectId')
const targetSystem = searchParams.get('targetSystem') || 'SHI'
-
- if (!contractId) {
+
+ if (!projectId) {
return NextResponse.json(
- { error: 'Contract ID is required' },
+ { error: 'Project ID is required' },
{ status: 400 }
)
}
-
+
let status
try {
// 실제 데이터베이스에서 조회 시도
status = await syncService.getSyncStatus(
- parseInt(contractId),
+ parseInt(projectId),
targetSystem
)
} catch (error) {
@@ -56,7 +56,7 @@ export async function GET(request: NextRequest) {
// ✅ 데이터베이스 조회 실패시 임시 목업 데이터 반환
status = {
- contractId: parseInt(contractId),
+ projectId: parseInt(projectId),
targetSystem,
totalChanges: 15,
pendingChanges: 3, // 3건 대기 중 (빨간 뱃지 표시용)
@@ -67,10 +67,10 @@ export async function GET(request: NextRequest) {
syncEnabled: true
}
}
-
+
// JSON 직렬화 가능한 형태로 변환
const serializedStatus = serializeForJSON(status)
-
+
return NextResponse.json(serializedStatus)
} catch (error) {
console.error('Failed to get sync status:', error)