mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
updating query
This commit is contained in:
parent
33aed82cea
commit
9236515bb6
@ -81,7 +81,7 @@ export default function AssetContent({
|
|||||||
)}
|
)}
|
||||||
<RelatedAssets
|
<RelatedAssets
|
||||||
tags={asset?.metadata?.tags}
|
tags={asset?.metadata?.tags}
|
||||||
dtAddress={asset?.datatokens?.[0]?.address}
|
nftAddress={asset?.nftAddress}
|
||||||
owner={asset?.nft?.owner}
|
owner={asset?.nft?.owner}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,18 +6,16 @@ import SectionQueryResult from '../../Home/SectionQueryResult'
|
|||||||
|
|
||||||
export default function RelatedAssets({
|
export default function RelatedAssets({
|
||||||
tags,
|
tags,
|
||||||
dtAddress,
|
nftAddress,
|
||||||
owner
|
owner
|
||||||
}: {
|
}: {
|
||||||
tags: string[]
|
tags: string[]
|
||||||
dtAddress: string
|
nftAddress: string
|
||||||
owner: string
|
owner: string
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { chainIds } = useUserPreferences()
|
const { chainIds } = useUserPreferences()
|
||||||
const [queryRelatedAssets, setQueryRelatedAssets] = useState<SearchQuery>()
|
const [queryRelatedAssets, setQueryRelatedAssets] = useState<SearchQuery>()
|
||||||
const modifiedSearchTerm =
|
console.log('nftAddress', nftAddress)
|
||||||
tags.toString().split(',').join(' OR ') + ' OR ' + owner.toLowerCase()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const baseParamsSales = {
|
const baseParamsSales = {
|
||||||
chainIds,
|
chainIds,
|
||||||
@ -27,7 +25,7 @@ export default function RelatedAssets({
|
|||||||
nestedQuery: {
|
nestedQuery: {
|
||||||
must_not: {
|
must_not: {
|
||||||
term: {
|
term: {
|
||||||
'nftAddress.keyword': '0x08d2eF7c255834dBB7513e8b3E744D05748a7079'
|
'nftAddress.keyword': nftAddress
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -39,7 +37,7 @@ export default function RelatedAssets({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
terms: {
|
terms: {
|
||||||
'metadata.tags.keyword': ['data-farming', 'ocean-market']
|
'metadata.tags.keyword': tags
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -61,7 +59,7 @@ export default function RelatedAssets({
|
|||||||
} as SortOptions
|
} as SortOptions
|
||||||
} as BaseQueryParams
|
} as BaseQueryParams
|
||||||
setQueryRelatedAssets(generateBaseQuery(baseParamsSales))
|
setQueryRelatedAssets(generateBaseQuery(baseParamsSales))
|
||||||
}, [chainIds, dtAddress, modifiedSearchTerm])
|
}, [chainIds, nftAddress])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionQueryResult title="Related Assets" query={queryRelatedAssets} />
|
<SectionQueryResult title="Related Assets" query={queryRelatedAssets} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user