diff --git a/src/app/api/admin/import/organize/route.ts b/src/app/api/admin/import/organize/route.ts index f1329ec8..0a2383dd 100644 --- a/src/app/api/admin/import/organize/route.ts +++ b/src/app/api/admin/import/organize/route.ts @@ -33,10 +33,14 @@ export const GET = withAdmin( { permission: PERMS.CATALOG_VIEW }, async (request) => { const sp = request.nextUrl.searchParams; - const limit = Math.min( - Math.max(Number(sp.get("limit") || 500) || 500, 1), - 1000, - ); + // No limit means "show everything" — the query is bounded by the actual + // size of the imported-furniture tree anyway. The cap only guards against + // pathological databases. + const rawLimit = Number(sp.get("limit")); + const limit = + Number.isFinite(rawLimit) && rawLimit > 0 + ? Math.min(rawLimit, 50000) + : 50000; const days = Math.min(Math.max(Number(sp.get("days") || 30) || 30, 1), 365); const sinceIso = new Date( Date.now() - days * 24 * 60 * 60 * 1000,