feat(ux-26): implement real shop pagination with deep-link page support and regression test

This commit is contained in:
devops committed 2026-10-17 18:15:42 +00:00
1 parent 92065cc7f2
commit 21f7768cce
3 files changed
+115 -22

No files matched your search

+3
View File
@@ -43,6 +43,8 @@ export default async function Shop({ searchParams }: { searchParams: Promise<{ [
const symptomsParam = typeof resolvedParams.symptoms === 'string' ? resolvedParams.symptoms : "";
const symptomSingle = typeof resolvedParams.symptom === 'string' ? resolvedParams.symptom : "";
const symptoms = symptomsParam || (symptomSingle ? symptomSingle : "");
const pageParam = typeof resolvedParams.page === "string" ? parseInt(resolvedParams.page, 10) : 1;
const initialPage = isNaN(pageParam) || pageParam < 1 ? 1 : pageParam;
const { data: initialProducts } = await productService.getProducts({ category, petType: petType as PetType | "all", query: search, symptom: symptomSingle, limit: 999 });
return (
@@ -52,6 +54,7 @@ export default async function Shop({ searchParams }: { searchParams: Promise<{ [
initialPetType={petType}
initialSymptoms={symptoms}
initialProducts={initialProducts}
initialPage={initialPage}
/>
);
}