From d1cde0f44d29ea2c94f22b3c380e4527a1b15cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Tue, 24 Oct 2023 19:56:38 +0800 Subject: [PATCH] feat(nocodb): export defaultLimitConfig --- packages/nocodb/src/helpers/extractLimitAndOffset.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/helpers/extractLimitAndOffset.ts b/packages/nocodb/src/helpers/extractLimitAndOffset.ts index 1cf5072aa3..ac5243152d 100644 --- a/packages/nocodb/src/helpers/extractLimitAndOffset.ts +++ b/packages/nocodb/src/helpers/extractLimitAndOffset.ts @@ -1,4 +1,4 @@ -const config = { +export const defaultLimitConfig = { limitDefault: Math.max(+process.env.DB_QUERY_LIMIT_DEFAULT || 25, 1), limitMin: Math.max(+process.env.DB_QUERY_LIMIT_MIN || 1, 1), limitMax: Math.max(+process.env.DB_QUERY_LIMIT_MAX || 1000, 1), @@ -25,10 +25,10 @@ export function extractLimitAndOffset( Math.min( limit && limit > 0 && Number.isInteger(limit) ? limit - : config.limitDefault, - config.limitMax, + : defaultLimitConfig.limitDefault, + defaultLimitConfig.limitMax, ), - config.limitMin, + defaultLimitConfig.limitMin, ); // skip any invalid offset, ignore negative and non-integer values