summaryrefslogtreecommitdiff
path: root/app/api/nonsap-sync/status/route.ts
blob: 1f0f076bb2f270f8e2cfb425a734db7638b01883 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { NextResponse } from 'next/server';
import { getSyncProgressEnhanced } from '@/lib/nonsap-sync/enhanced-sync-service';

export async function GET() {
  try {
    const progress = await getSyncProgressEnhanced();
    
    return NextResponse.json({
      success: true,
      data: progress,
      timestamp: new Date().toISOString()
    });
  } catch (error) {
    console.error('Error getting sync progress:', error);
    
    return NextResponse.json({
      success: false,
      error: 'Failed to get sync progress',
      timestamp: new Date().toISOString()
    }, { status: 500 });
  }
}