updating getAllLiveProducts to handle no param

This commit is contained in:
Samantha Kellow 2024-04-24 17:50:55 +01:00
parent 0bf97ecdf6
commit 545717006d

View File

@ -29,8 +29,9 @@ export async function getLiveCollectionProducts(query: Parameters<typeof getColl
return liveProducts;
}
export async function getAllLiveProducts(query: Parameters<typeof getProducts>[0]) {
const products = await getProducts(query);
export async function getAllLiveProducts(query?: Parameters<typeof getProducts>[0]) {
const searchQuery = query || { query: undefined, reverse: undefined, sortKey: undefined}
const products = await getProducts(searchQuery);
const liveProducts = products.filter((product) => !product.tags.includes('hidden-product'));
return liveProducts
}