mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 12:47:50 +00:00
updating getAllLiveProducts to handle no param
This commit is contained in:
parent
0bf97ecdf6
commit
545717006d
@ -29,8 +29,9 @@ export async function getLiveCollectionProducts(query: Parameters<typeof getColl
|
|||||||
return liveProducts;
|
return liveProducts;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAllLiveProducts(query: Parameters<typeof getProducts>[0]) {
|
export async function getAllLiveProducts(query?: Parameters<typeof getProducts>[0]) {
|
||||||
const products = await getProducts(query);
|
const searchQuery = query || { query: undefined, reverse: undefined, sortKey: undefined}
|
||||||
|
const products = await getProducts(searchQuery);
|
||||||
const liveProducts = products.filter((product) => !product.tags.includes('hidden-product'));
|
const liveProducts = products.filter((product) => !product.tags.includes('hidden-product'));
|
||||||
return liveProducts
|
return liveProducts
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user