mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
feat(poc): add page parameter for collection
This commit is contained in:
@@ -31,11 +31,12 @@ export default async function CategoryPage({
|
||||
params: { collection: string };
|
||||
searchParams?: { [key: string]: string | string[] | undefined };
|
||||
}) {
|
||||
const { sort } = searchParams as { [key: string]: string };
|
||||
const { sort, page } = searchParams as { [key: string]: string };
|
||||
const { sortKey, reverse } = sorting.find((item) => item.slug === sort) || defaultSort;
|
||||
|
||||
const products = await getCollectionProducts({
|
||||
collection: params.collection,
|
||||
page: page ? parseInt(page) : 1,
|
||||
sortKey,
|
||||
reverse
|
||||
});
|
||||
|
Reference in New Issue
Block a user