From c901e1605dedf3b717d5dc2c2f71801700d62142 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Fri, 8 Mar 2024 14:51:32 -0500 Subject: [PATCH] fix: pagination on marketplace ids --- src/api/registry.js | 2 +- src/controllers.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/registry.js b/src/api/registry.js index e08e8a6..8e0d474 100644 --- a/src/api/registry.js +++ b/src/api/registry.js @@ -698,7 +698,7 @@ const getTokenizedUnitByAssetId = async (assetId) => { ); } - return response.body; + return response?.body?.data || []; } catch (error) { logger.error(`Could not get tokenized unit by asset id: ${error.message}`); diff --git a/src/controllers.js b/src/controllers.js index 85b9202..c47ada6 100644 --- a/src/controllers.js +++ b/src/controllers.js @@ -109,7 +109,7 @@ const parseDetokFile = async (req, res) => { const unitToBeDetokenizedResponse = await registry.getTokenizedUnitByAssetId(assetId); - let unitToBeDetokenized = JSON.parse(unitToBeDetokenizedResponse); + let unitToBeDetokenized = unitToBeDetokenizedResponse; if (unitToBeDetokenized.length) { unitToBeDetokenized = unitToBeDetokenized[0]; }