diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index a3a3bbc8..c28f9251 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -122,12 +122,13 @@ function CreatorContractsGrid(props: { contracts: Contract[] }) { function TagContractsGrid(props: { contracts: Contract[] }) { const { contracts } = props - const contractTags = _.flatMap(contracts, (contract) => - parseTags(contract.question + ' ' + contract.description).map((tag) => ({ + const contractTags = _.flatMap(contracts, (contract) => { + const { tags } = contract + return tags.map((tag) => ({ tag, contract, })) - ) + }) const groupedByTag = _.groupBy(contractTags, ({ tag }) => tag) const byTag = _.mapValues(groupedByTag, (contractTags) => contractTags.map(({ contract }) => contract) @@ -210,7 +211,8 @@ export function SearchableGrid(props: { check(c.question) || check(c.description) || check(c.creatorName) || - check(c.creatorUsername) + check(c.creatorUsername) || + check(c.lowercaseTags.map((tag) => `#${tag}`).join(' ')) ) if (sort === 'newest' || sort === 'all') {