Skip to content

Commit 59a324f

Browse files
Only use array versions of expand
1 parent 6e19eba commit 59a324f

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

src/app/[country]/[locale]/(storefront)/products/[slug]/ProductDetailsWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function ProductDetailsWrapper({
2929
setLoading(true);
3030
try {
3131
const data = await getProduct(slug, {
32-
expand: "variants,images,option_types",
32+
expand: ["variants", "images", "option_types"],
3333
});
3434
if (!cancelled) {
3535
setProduct(data);

src/app/[country]/[locale]/(storefront)/t/[...permalink]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export default async function CategoryPage({ params }: CategoryPageProps) {
2121

2222
let taxon;
2323
try {
24-
taxon = await getTaxon(fullPermalink, { expand: "ancestors,children" });
24+
taxon = await getTaxon(fullPermalink, {
25+
expand: ["ancestors", "children"],
26+
});
2527
} catch (error) {
2628
console.error("Failed to fetch taxon:", error);
2729
notFound();

src/app/[country]/[locale]/(storefront)/taxonomies/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function CategoriesPage({ params }: CategoriesPageProps) {
2727
try {
2828
const response = await getTaxonomies({
2929
limit: 100,
30-
expand: "taxons",
30+
expand: ["taxons"],
3131
});
3232
taxonomies = response.data;
3333
} catch (error) {

src/lib/data/countries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export async function getCountries() {
1010
}
1111

1212
export async function getCountry(iso: string) {
13-
return _getCountry(iso, { expand: "states" });
13+
return _getCountry(iso, { expand: ["states"] });
1414
}

src/lib/data/products.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function getProducts(params?: ProductListParams) {
1414

1515
export async function getProduct(
1616
slugOrId: string,
17-
params?: { expand?: string },
17+
params?: { expand?: string[] },
1818
) {
1919
return _getProduct(slugOrId, params);
2020
}

0 commit comments

Comments
 (0)