chore: remove no longer used anayltics query (#6165)
* chore: remove no longer used anayltics query * Remove from index --------- Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
This commit is contained in:
parent
0f8d3fa506
commit
8d36edf2b7
@ -1,6 +1,5 @@
|
||||
export * from './ActivityFetcher'
|
||||
export * from './CollectionPreviewFetcher'
|
||||
export * from './logListing'
|
||||
export * from './RouteFetcher'
|
||||
export * from './SearchCollectionsFetcher'
|
||||
export * from './TrendingCollectionsFetcher'
|
||||
|
@ -1,36 +0,0 @@
|
||||
import { ListingMarket, ListingRow } from 'nft/types'
|
||||
|
||||
interface Listing extends ListingRow {
|
||||
marketplaces: ListingMarket[]
|
||||
}
|
||||
|
||||
export const logListing = async (listings: ListingRow[], userAddress: string): Promise<boolean> => {
|
||||
const url = `${process.env.REACT_APP_TEMP_API_URL}/nft/logGenieList`
|
||||
const listingsConsolidated: Listing[] = listings.map((el) => ({ ...el, marketplaces: [] }))
|
||||
const marketplacesById: Record<string, ListingMarket[]> = {}
|
||||
const listingsWithMarketsConsolidated = listingsConsolidated.reduce((uniqueListings, curr) => {
|
||||
const key = `${curr.asset.asset_contract.address}-${curr.asset.tokenId}`
|
||||
if (marketplacesById[key]) {
|
||||
marketplacesById[key].push(curr.marketplace)
|
||||
} else {
|
||||
marketplacesById[key] = [curr.marketplace]
|
||||
}
|
||||
if (!uniqueListings.some((listing) => `${listing.asset.asset_contract.address}-${listing.asset.tokenId}` === key)) {
|
||||
curr.marketplaces = marketplacesById[key]
|
||||
uniqueListings.push(curr)
|
||||
}
|
||||
return uniqueListings
|
||||
}, [] as Listing[])
|
||||
const payload = {
|
||||
listings: listingsWithMarketsConsolidated,
|
||||
userAddress,
|
||||
}
|
||||
const r = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
return r.status === 200
|
||||
}
|
Loading…
Reference in New Issue
Block a user