Skip to content

Commit 6038911

Browse files
ntsekourashbhalodiaoandregalt-hamano
authored
DataViews: Fix pagination (#73132)
Co-authored-by: ntsekouras <[email protected]> Co-authored-by: hbhalodia <[email protected]> Co-authored-by: oandregal <[email protected]> Co-authored-by: t-hamano <[email protected]>
1 parent a7ebbc0 commit 6038911

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/edit-site/src/components/page-patterns/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default function DataviewsPatterns() {
106106
slug: categoryId,
107107
defaultView: DEFAULT_VIEW,
108108
queryParams: {
109-
page: Number( query.pageNumber ?? 1 ),
109+
page: query.pageNumber,
110110
search: query.search,
111111
},
112112
onChangeQueryParams: ( params ) => {

packages/views/src/use-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function useView( config: ViewConfig ): UseViewReturn {
6666
const { set } = useDispatch( preferencesStore );
6767

6868
const baseView: View = persistedView ?? defaultView;
69-
const page = queryParams?.page ?? baseView.page ?? 1;
69+
const page = Number( queryParams?.page ?? baseView.page ?? 1 );
7070
const search = queryParams?.search ?? baseView.search ?? '';
7171

7272
// Merge URL query parameters (page, search) into the view

0 commit comments

Comments
 (0)