From 79e2dcb744d4babe12da744d64e41d08ff1d3dfe Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:54:11 +0100 Subject: [PATCH] refactor(*): Cast instead of declaring a new const --- src/lib/utils/supabase/admin.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/utils/supabase/admin.ts b/src/lib/utils/supabase/admin.ts index 79725be..cad3b0a 100644 --- a/src/lib/utils/supabase/admin.ts +++ b/src/lib/utils/supabase/admin.ts @@ -430,9 +430,7 @@ const getActiveProductsWithPrices = async (limit = 10, offset = 0) => { throw new Error(`Error fetching products: ${error.message}`); } - const typedProducts: ProductWithPrices[] = products; - - for (const product of typedProducts) { + for (const product of products as ProductWithPrices[]) { if (product.prices && product.prices.length > 0) { // Assuming the default price is the first one const defaultPrice = product.prices[0]; @@ -440,7 +438,7 @@ const getActiveProductsWithPrices = async (limit = 10, offset = 0) => { } } - return { products: typedProducts, count }; // Return products and total count + return { products, count }; // Return products and total count }; export {