Skip to content

Commit

Permalink
Merge pull request #387 from Kpoke/master
Browse files Browse the repository at this point in the history
add token_count
  • Loading branch information
Kpoke authored Aug 3, 2023
2 parents 92ba358 + 0762d79 commit 8f283f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/handlers/transferHandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ const transferGet = async (req, res) => {
const transferService = new TransferService();
const transfers = await transferService.getByFilter(req.query, req.wallet_id);

res.status(200).json({ transfers });
const modifiedTransfers = transfers.map((t) => ({
...t,
token_count:
+t.parameters?.bundle?.bundleSize || +t.parameters?.tokens?.length,
}));

res.status(200).json({ transfers: modifiedTransfers });
};

const transferIdGet = async (req, res) => {
Expand Down

0 comments on commit 8f283f1

Please sign in to comment.