Skip to content

Commit

Permalink
fix: limit offset to 1000 for API by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters committed Oct 30, 2023
1 parent 414665d commit b228716
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ METRICS_PORT=3005
COLLECT_DB_CONNECTION_POOL_METRICS_INTERVAL=10000
PORT=3020
LOG_LEVEL=debug
LIMITED_PAGINATION_MAX_ITEMS=100000
LIMITED_PAGINATION_MAX_ITEMS=10000
API_LIMITED_PAGINATION_MAX_ITEMS=1000
DISABLE_API_SCHEMA_DOCS=false
DISABLE_BFF_API_SCHEMA_DOCS=false
DISABLE_EXTERNAL_API=false
Expand Down
1 change: 1 addition & 0 deletions packages/api/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ DATABASE_URL='postgres://postgres:postgres@localhost:5432/block-explorer-e2e'
METRICS_PORT=3005
PORT=3007
LIMITED_PAGINATION_MAX_ITEMS=15
API_LIMITED_PAGINATION_MAX_ITEMS=15
CONTRACT_VERIFICATION_API_URL=http://verification.api
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PagingOptionsDto } from "./pagingOptions.dto";
import { config } from "dotenv";
config();

const maxItemsLimit = parseInt(process.env.LIMITED_PAGINATION_MAX_ITEMS, 10) || 10000;
const maxItemsLimit = parseInt(process.env.API_LIMITED_PAGINATION_MAX_ITEMS, 10) || 1000;

export class PagingOptionsWithMaxItemsLimitDto extends PagingOptionsDto {
@ApiPropertyOptional({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PagingOptionsDto } from "./pagingOptions.dto";
import { config } from "dotenv";
config();

const maxItemsLimit = parseInt(process.env.LIMITED_PAGINATION_MAX_ITEMS, 10) || 100000;
const maxItemsLimit = parseInt(process.env.LIMITED_PAGINATION_MAX_ITEMS, 10) || 10000;

export class PagingOptionsWithMaxItemsLimitDto extends PagingOptionsDto {
@ApiPropertyOptional({
Expand Down

0 comments on commit b228716

Please sign in to comment.