From 545717006d7f25f36e71b67873d01316aeeafcf9 Mon Sep 17 00:00:00 2001 From: Samantha Kellow Date: Wed, 24 Apr 2024 17:50:55 +0100 Subject: [PATCH] updating getAllLiveProducts to handle no param --- lib/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/utils.ts b/lib/utils.ts index 3a036949e..9150dea96 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -29,8 +29,9 @@ export async function getLiveCollectionProducts(query: Parameters[0]) { - const products = await getProducts(query); +export async function getAllLiveProducts(query?: Parameters[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 }