diff --git a/package-lock.json b/package-lock.json index 3b45c62..7da2a4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nft-marketplace-api", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nft-marketplace-api", - "version": "1.3.0", + "version": "1.4.0", "license": "ISC", "dependencies": { "@sentry/node": "^6.14.1", diff --git a/src/api/services/nft.ts b/src/api/services/nft.ts index 1594812..d48de09 100644 --- a/src/api/services/nft.ts +++ b/src/api/services/nft.ts @@ -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"); @@ -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");