Add to totalPrizes (not prizeTotal)
This commit is contained in:
parent
97c0a5cfa8
commit
e3e08f449c
|
@ -146,7 +146,7 @@ export type Bounty = {
|
|||
prizes: {
|
||||
[giverId: string]: number
|
||||
}
|
||||
prizeTotal: number
|
||||
totalPrizes: number
|
||||
}
|
||||
|
||||
export type outcomeType = AnyOutcomeType['outcomeType']
|
||||
|
|
|
@ -171,7 +171,7 @@ function getBountyProps(ante: number, creator: User) {
|
|||
prizes: {
|
||||
[creator.id]: ante,
|
||||
},
|
||||
prizeTotal: ante,
|
||||
totalPrizes: ante,
|
||||
}
|
||||
return system
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ export const addbounty = newEndpoint({}, async (req, auth) => {
|
|||
|
||||
if (user.balance < amount) throw new APIError(400, 'Insufficient balance')
|
||||
|
||||
// TODO: Capture with txns?
|
||||
transaction.update(userDoc, {
|
||||
balance: user.balance - amount,
|
||||
totalDeposits: user.totalDeposits - amount,
|
||||
|
@ -46,6 +47,7 @@ export const addbounty = newEndpoint({}, async (req, auth) => {
|
|||
...contract.prizes,
|
||||
[user.id]: existingPrize + amount,
|
||||
},
|
||||
totalPrizes: contract.totalPrizes + amount,
|
||||
})
|
||||
|
||||
return { status: 'success' }
|
||||
|
|
Loading…
Reference in New Issue
Block a user