From 47eb8abed07d1807d38b0e88ed95c760384629c2 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 13 Oct 2022 16:05:40 -0500 Subject: [PATCH] Don't include loans in email payout message --- functions/src/resolve-market.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/src/resolve-market.ts b/functions/src/resolve-market.ts index 347bf055..16870699 100644 --- a/functions/src/resolve-market.ts +++ b/functions/src/resolve-market.ts @@ -171,12 +171,12 @@ export const resolveMarket = async ( const openBets = bets.filter((b) => !b.isSold && !b.sale) const loanPayouts = getLoanPayouts(openBets) - const payouts = [ + const payoutsWithoutLoans = [ { userId: creatorId, payout: creatorPayout, deposit: creatorPayout }, ...liquidityPayouts.map((p) => ({ ...p, deposit: p.payout })), ...traderPayouts, - ...loanPayouts, ] + const payouts = [...payoutsWithoutLoans, ...loanPayouts] if (!isProd()) console.log( @@ -208,7 +208,7 @@ export const resolveMarket = async ( await undoUniqueBettorRewardsIfCancelResolution(contract, outcome) await revalidateStaticProps(getContractPath(contract)) - const userPayoutsWithoutLoans = groupPayoutsByUser(payouts) + const userPayoutsWithoutLoans = groupPayoutsByUser(payoutsWithoutLoans) const userInvestments = mapValues( groupBy(bets, (bet) => bet.userId),