Skip to content

Commit

Permalink
fix: add token_count to GET /transfer result
Browse files Browse the repository at this point in the history
  • Loading branch information
Kpoke committed Aug 3, 2023
1 parent 92ba358 commit 0762d79
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 0762d79

Please sign in to comment.