fixed issue wiht comment parser total value

This commit is contained in:
Nouman Tahir 2021-07-09 21:31:16 +05:00
parent 15901ccb3d
commit 5642819488

View File

@ -82,6 +82,14 @@ export const parseComments = async (comments) => {
comment.markdownBody = get(comment, 'body'); comment.markdownBody = get(comment, 'body');
comment.body = renderPostBody(comment, true, webp); comment.body = renderPostBody(comment, true, webp);
//calculate and set total_payout to show to user.
const totalPayout =
parseAsset(comment.pending_payout_value).amount +
parseAsset(comment.author_payout_value).amount +
parseAsset(comment.curator_payout_value).amount;
comment.total_payout = totalPayout;
//stamp comments with fetched time; //stamp comments with fetched time;
comment.post_fetched_at = new Date().getTime(); comment.post_fetched_at = new Date().getTime();