Skip to content

Commit

Permalink
fix: paginated requests for units
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Mar 6, 2024
1 parent 67e9a29 commit f1efebb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "climate-tokenization-engine",
"version": "1.3.16",
"version": "1.3.17",
"bin": "./src/server.js",
"description": "",
"main": "proxy.js",
Expand Down
13 changes: 8 additions & 5 deletions src/api/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,15 @@ const retireUnit = async (unit, beneficiaryName, beneficiaryAddress) => {
const getAssetUnitBlocks = async (marketplaceIdentifier) => {
try {
logger.debug(
`GET ${registryUri}/v1/units?filter=marketplaceIdentifier:${marketplaceIdentifier}:eq`
`GET ${registryUri}/v1/units?filter=marketplaceIdentifier:${marketplaceIdentifier}:eq&page=1&limit=1000`
);
const response = await superagent
.get(
`${registryUri}/v1/units?filter=marketplaceIdentifier:${marketplaceIdentifier}:eq`
)
.get(`${registryUri}/v1/units`)
.query({
filter: `marketplaceIdentifier:${marketplaceIdentifier}:eq`,
page: 1,
limit: 1000,
})
.set(maybeAppendRegistryApiKey());

if (response.status === 403) {
Expand Down Expand Up @@ -590,7 +593,7 @@ const waitForRegistryDataSync = async (options = {}) => {
allowUnverifiedCert: config.ALLOW_SELF_SIGNED_CERTIFICATES,
};

if (['debug', 'trace'].includes(CONFIG().GENERAL.LOG_LEVEL)) {
if (["debug", "trace"].includes(CONFIG().GENERAL.LOG_LEVEL)) {
dataLayerConfig.verbose = true;
}

Expand Down

0 comments on commit f1efebb

Please sign in to comment.