Skip to content

Commit

Permalink
Merge pull request #241 from decentraland/feat/use-nft-owner-and-address
Browse files Browse the repository at this point in the history
feat: add nft owner and order owner check to catalog and orders queries
  • Loading branch information
juanmahidalgo authored Jan 7, 2025
2 parents 0b68bae + 5a7c15d commit 8c85afd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ports/catalog/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ export const getCollectionsItemsCatalogQueryWithTrades = (filters: CatalogQueryF
SQL`.order AS orders
WHERE
orders.status = 'open'
AND orders.expires_at_normalized > NOW() AND nft.owner_address = orders.owner`
AND orders.expires_at_normalized > NOW() AND nft.owner_address = orders.owner AND nft.owner_address = orders.owner`
)
)
.append(getOrderRangePriceWhere(filters))
Expand Down
2 changes: 1 addition & 1 deletion src/ports/orders/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function getLegacyOrdersQuery(): string {
ord.expires_at,
ord.network
FROM squid_marketplace."order" ord
JOIN squid_marketplace."nft" nft ON ord.nft_id = nft.id`
JOIN squid_marketplace."nft" nft ON ord.nft_id = nft.id AND nft.owner_address = ord.owner`
}

export interface OrderQueries {
Expand Down

0 comments on commit 8c85afd

Please sign in to comment.