File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,21 +12,20 @@ import { parseCreatorSortOptions } from './creator.utils';
1212import { safeIntParam } from '../../utils/query.utils' ;
1313import { parsePublicQuery } from '../../utils/public-query-parse.utils' ;
1414import {
15- DEFAULT_PAGE ,
16- DEFAULT_PAGE_SIZE ,
1715 MIN_PAGE_SIZE ,
1816 MAX_PAGE_SIZE ,
1917} from '../../constants/pagination.constants' ;
18+ import { PUBLIC_PAGE_PAGINATION_DEFAULTS } from '../../utils/public-list-query-defaults' ;
2019
2120const LegacyCreatorQuerySchema = z . object ( {
2221 page : safeIntParam ( {
23- defaultValue : DEFAULT_PAGE ,
22+ defaultValue : PUBLIC_PAGE_PAGINATION_DEFAULTS . page ,
2423 min : MIN_PAGE_SIZE ,
2524 max : Number . MAX_SAFE_INTEGER ,
2625 label : 'Page' ,
2726 } ) ,
2827 limit : safeIntParam ( {
29- defaultValue : DEFAULT_PAGE_SIZE ,
28+ defaultValue : PUBLIC_PAGE_PAGINATION_DEFAULTS . limit ,
3029 min : MIN_PAGE_SIZE ,
3130 max : MAX_PAGE_SIZE ,
3231 label : 'Limit' ,
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ import {
55} from './creators.sort' ;
66import { safeIntParam } from '../../utils/query.utils' ;
77import {
8- DEFAULT_PAGE_SIZE ,
9- DEFAULT_OFFSET ,
108 MIN_PAGE_SIZE ,
119 MAX_PAGE_SIZE ,
1210} from '../../constants/pagination.constants' ;
11+ import { PUBLIC_OFFSET_PAGINATION_DEFAULTS } from '../../utils/public-list-query-defaults' ;
1312
1413/**
1514 * Validation schema for creator list query parameters.
@@ -23,13 +22,13 @@ import {
2322export const CreatorListQuerySchema = z . object ( {
2423 // Pagination
2524 limit : safeIntParam ( {
26- defaultValue : DEFAULT_PAGE_SIZE ,
25+ defaultValue : PUBLIC_OFFSET_PAGINATION_DEFAULTS . limit ,
2726 min : MIN_PAGE_SIZE ,
2827 max : MAX_PAGE_SIZE ,
2928 label : 'Limit' ,
3029 } ) ,
3130 offset : safeIntParam ( {
32- defaultValue : DEFAULT_OFFSET ,
31+ defaultValue : PUBLIC_OFFSET_PAGINATION_DEFAULTS . offset ,
3332 min : 0 ,
3433 max : Number . MAX_SAFE_INTEGER ,
3534 label : 'Offset' ,
Original file line number Diff line number Diff line change 1+ import {
2+ DEFAULT_OFFSET ,
3+ DEFAULT_PAGE ,
4+ DEFAULT_PAGE_SIZE ,
5+ } from '../constants/pagination.constants' ;
6+
7+ /**
8+ * Shared default query values for offset-based public list endpoints.
9+ * Keeps defaults centralized without introducing validation behavior.
10+ */
11+ export const PUBLIC_OFFSET_PAGINATION_DEFAULTS = {
12+ limit : DEFAULT_PAGE_SIZE ,
13+ offset : DEFAULT_OFFSET ,
14+ } as const ;
15+
16+ /**
17+ * Shared default query values for page-based public list endpoints.
18+ * Keeps defaults centralized without introducing validation behavior.
19+ */
20+ export const PUBLIC_PAGE_PAGINATION_DEFAULTS = {
21+ page : DEFAULT_PAGE ,
22+ limit : DEFAULT_PAGE_SIZE ,
23+ } as const ;
You can’t perform that action at this time.
0 commit comments