Skip to content

Commit

Permalink
fix: nfts on sale being limited when asked by owner
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Dec 10, 2024
1 parent 9200da1 commit f358824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ports/nfts/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ function getFilteredNFTCTE(nftFilters: GetNFTsFilters, uncapped = false): SQLSta
`
.append(whereClause)
.append(getNFTsSortByStatement(nftFilters.sortBy))
.append(uncapped || nftFilters.sortBy === NFTSortBy.RECENTLY_LISTED ? SQL`` : getNFTLimitAndOffsetStatement(nftFilters))
.append(
uncapped || nftFilters.sortBy === NFTSortBy.RECENTLY_LISTED || !!nftFilters.owner ? SQL`` : getNFTLimitAndOffsetStatement(nftFilters)
)
.append(SQL`)`)
}

Expand Down
4 changes: 2 additions & 2 deletions src/ports/orders/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ function getOrdersSortByStatement(filters: OrderFilters): SQLStatement {
}

function getOrdersLimitAndOffsetStatement(filters: OrderFilters) {
const limit = filters?.first ? filters.first : 100
const limit = filters?.first ? filters.first : 1000
const offset = filters?.skip ? filters.skip : 0

return SQL` LIMIT ${limit} OFFSET ${offset} `
}

function getInnerOrdersLimitAndOffsetStatement(filters: OrderFilters) {
const finalLimit = filters?.first ? filters.first : 100
const finalLimit = filters?.first ? filters.first : 1000
const finalOffset = filters?.skip ? filters.skip : 0

// For inner queries, we need to fetch enough records to account for the final offset
Expand Down

0 comments on commit f358824

Please sign in to comment.