fix(shop): render products from server data
Deploy Canina / deploy (push) Successful in 2m8s

This commit is contained in:
devops committed 2026-10-16 19:48:37 +00:00
1 parent 1de8fd9a60
commit bec76393bb
3 files changed
+25 -4

No files matched your search

+4
View File
@@ -1,6 +1,8 @@
import type { Metadata } from "next";
import ArchivePage from "../../components/ArchivePage";
import { getPageMetadata } from "../../lib/seo";
import { productService } from "../../lib/services/productService";
import type { PetType } from "../../lib/data/products";
export async function generateMetadata({
searchParams,
@@ -41,6 +43,7 @@ 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 { data: initialProducts } = await productService.getProducts({ category, petType: petType as PetType | "all", query: search, symptom: symptomSingle, limit: 999 });
return (
<ArchivePage
@@ -48,6 +51,7 @@ export default async function Shop({ searchParams }: { searchParams: Promise<{ [
initialSearch={search}
initialPetType={petType}
initialSymptoms={symptoms}
initialProducts={initialProducts}
/>
);
}