From 1d8f53de375d0d388e3eef7978d75dbf9f7f5866 Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Sun, 15 Dec 2024 20:16:30 +0100 Subject: [PATCH] fix: add size filter if there is owner --- src/ports/nfts/landQueries.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ports/nfts/landQueries.ts b/src/ports/nfts/landQueries.ts index 90e818e..6c64e0c 100644 --- a/src/ports/nfts/landQueries.ts +++ b/src/ports/nfts/landQueries.ts @@ -77,7 +77,9 @@ export function getLANDs(nftFilters: GetNFTsFilters): SQLStatement { SELECT * FROM squid_marketplace.nft ` - .append(getWhereStatementFromFilters([SQL`search_is_land = true`, SQL` search_estate_size > 0`, NFT_OWNER_FILTER])) + .append( + getWhereStatementFromFilters([SQL`search_is_land = true`, NFT_OWNER_FILTER ? SQL` search_estate_size > 0` : null, NFT_OWNER_FILTER]) + ) .append(ids ? SQL` AND id = ANY(${ids}) ` : SQL``) .append( SQL`