route.ts 392 B

123456789
  1. import { NextRequest, NextResponse } from 'next/server'
  2. import { getCopyHistory } from '@/lib/db/queries'
  3. export async function GET(req: NextRequest) {
  4. const limit = parseInt(req.nextUrl.searchParams.get('limit') || '50', 10)
  5. const offset = parseInt(req.nextUrl.searchParams.get('offset') || '0', 10)
  6. const history = getCopyHistory(limit, offset)
  7. return NextResponse.json(history)
  8. }