Skip to content

Commit

Permalink
Merge pull request #287 from reservoirprotocol/armando/grwth-3038-get…
Browse files Browse the repository at this point in the history
…ting-a-400-error-from-the-collections-api-on-homepage-for

armando/grwth-3038-getting-a-400-error-from-the-collections-api-on-homepage-for
  • Loading branch information
pedromcunha authored Jul 31, 2023
2 parents 0a608b5 + fa3acf0 commit 03f927e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hooks/useTopSellingCollections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

1 comment on commit 03f927e

@vercel
Copy link

@vercel vercel bot commented on 03f927e Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.