From 61c7519beaa5310437c4f530d0063fbacccecabb Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 11 Sep 2026 20:33:27 +0200 Subject: [PATCH] fix(studio): show all offers in the imported-furniture tree The organize-imports route defaulted to a 500-item limit, silently hiding offers beyond the first batch of imported pages. Remove the effective cap (limit now means 'all', guarded only by a 50k lint cap) so every offer already sitting in the import tree is returned and grouped. --- src/app/api/admin/import/organize/route.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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,