This commit is contained in:
1 parent
1de8fd9a60
commit
bec76393bb
3 files changed
+25
-4
No files matched your search
@@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user