diff --git a/app/api/sync/schedules/[id]/route.ts b/app/api/sync/schedules/[id]/route.ts index 6012456..9ad32d7 100644 --- a/app/api/sync/schedules/[id]/route.ts +++ b/app/api/sync/schedules/[id]/route.ts @@ -12,10 +12,11 @@ import { syncScheduler } from '@/lib/services/sync-scheduler'; */ export async function GET( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { - const schedule = await syncScheduler.getSchedule(params.id); + const { id } = await params; + const schedule = await syncScheduler.getSchedule(id); if (!schedule) { return NextResponse.json( @@ -45,12 +46,13 @@ export async function GET( */ export async function PATCH( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { + const { id } = await params; const body = await request.json(); - const schedule = await syncScheduler.updateSchedule(params.id, body); + const schedule = await syncScheduler.updateSchedule(id, body); return NextResponse.json({ success: true, @@ -73,10 +75,11 @@ export async function PATCH( */ export async function DELETE( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { - await syncScheduler.deleteSchedule(params.id); + const { id } = await params; + await syncScheduler.deleteSchedule(id); return NextResponse.json({ success: true, diff --git a/app/api/sync/schedules/[id]/trigger/route.ts b/app/api/sync/schedules/[id]/trigger/route.ts index 9763b72..c7738bb 100644 --- a/app/api/sync/schedules/[id]/trigger/route.ts +++ b/app/api/sync/schedules/[id]/trigger/route.ts @@ -12,10 +12,11 @@ import { syncScheduler } from '@/lib/services/sync-scheduler'; */ export async function POST( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { - await syncScheduler.triggerSchedule(params.id); + const { id } = await params; + await syncScheduler.triggerSchedule(id); return NextResponse.json({ success: true,