From fa3acf01f678c39e312fd842121c2f6b03bce980 Mon Sep 17 00:00:00 2001 From: armando Date: Fri, 28 Jul 2023 11:13:10 -0700 Subject: [PATCH] feat: Fix 400 error --- hooks/useTopSellingCollections.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hooks/useTopSellingCollections.ts b/hooks/useTopSellingCollections.ts index bb5771b5c..f33b056fc 100644 --- a/hooks/useTopSellingCollections.ts +++ b/hooks/useTopSellingCollections.ts @@ -35,9 +35,12 @@ export default function ( swrOptions ) - const ids = topSellingData?.collections?.map( - (collection) => collection.id as string - ) + const ids = topSellingData?.collections?.map((collection) => { + if (collection.id?.includes(':')) { + return collection.id.split(':')[0] as string + } + return collection.id as string + }) const { data: collections, isValidating: isValidatingCollections } = useCollections(