fix(studio): show all offers in the imported-furniture tree
CI / check (push) Successful in 2m23s
CI / deploy (push) Successful in 1m11s
CI / publish-container (push) Successful in 44s

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.
This commit is contained in:
openhands committed 2026-09-11 20:33:27 +02:00
1 parent 19dc0347df
commit 61c7519bea
1 file changed
+8 -4
+8 -4
View File
@@ -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,