Skip to content

Commit

Permalink
fix condition on totalCount
Browse files Browse the repository at this point in the history
  • Loading branch information
Leouarz committed Feb 22, 2022
1 parent 346fbc4 commit 12b22d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/api/services/nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export class NFTService {
try {
const gqlQuery = QueriesBuilder.countAllListedInMarketplace(query.marketplaceId)
const res = await request(indexerUrl, gqlQuery);
if (!res.nftEntities.totalCount) throw new Error()
if (res.nftEntities.totalCount === undefined) throw new Error()
return res.nftEntities.totalCount
} catch (err) {
throw new Error("Count could not have been fetched");
Expand All @@ -373,7 +373,7 @@ export class NFTService {

const gqlQuery = QueriesBuilder.countTotalFilteredNFTs(query);
const res = await request(indexerUrl, gqlQuery);
if (!res.nftEntities.totalCount) throw new Error();
if (res.nftEntities.totalCount === undefined) throw new Error();
return res.nftEntities.totalCount;
} catch (err) {
throw new Error("Filtered count could not have been fetched");
Expand Down

0 comments on commit 12b22d5

Please sign in to comment.