Make placeBet
/sellShares
immediately post denormalized info
This commit is contained in:
parent
298bc04517
commit
35454df6b2
|
@ -139,7 +139,14 @@ export const placebet = newEndpoint({}, async (req, auth) => {
|
|||
}
|
||||
|
||||
const betDoc = contractDoc.collection('bets').doc()
|
||||
trans.create(betDoc, { id: betDoc.id, userId: user.id, ...newBet })
|
||||
trans.create(betDoc, {
|
||||
id: betDoc.id,
|
||||
userId: user.id,
|
||||
userAvatarUrl: user.avatarUrl,
|
||||
userUsername: user.username,
|
||||
userName: user.name,
|
||||
...newBet,
|
||||
})
|
||||
log('Created new bet document.')
|
||||
|
||||
if (makers) {
|
||||
|
|
|
@ -112,6 +112,9 @@ export const sellshares = newEndpoint({}, async (req, auth) => {
|
|||
transaction.create(newBetDoc, {
|
||||
id: newBetDoc.id,
|
||||
userId: user.id,
|
||||
userAvatarUrl: user.avatarUrl,
|
||||
userUsername: user.username,
|
||||
userName: user.name,
|
||||
...newBet,
|
||||
})
|
||||
transaction.update(
|
||||
|
|
Loading…
Reference in New Issue
Block a user