restore on-create-bet

This commit is contained in:
Ian Philips 2022-08-24 10:26:40 -06:00
parent 951a66081e
commit 653515ff87

View File

@ -54,12 +54,14 @@ export const onCreateBet = functions.firestore
log(`Could not find contract ${contractId}`) log(`Could not find contract ${contractId}`)
return return
} }
await updateUniqueBettorsAndGiveCreatorBonus(contract, eventId, bet.userId)
const bettor = await getUser(bet.userId) const bettor = await getUser(bet.userId)
if (!bettor) return if (!bettor) return
await updateUniqueBettorsAndGiveCreatorBonus(contract, eventId, bet.userId)
await notifyFills(bet, contract, eventId, bettor) await notifyFills(bet, contract, eventId, bettor)
await updateBettingStreak(bettor, bet, contract, eventId) await updateBettingStreak(bettor, bet, contract, eventId)
await firestore.collection('users').doc(bettor.id).update({ lastBetTime }) await firestore.collection('users').doc(bettor.id).update({ lastBetTime })
}) })