Fix breakages

This commit is contained in:
Austin Chen 2022-04-29 11:38:22 -04:00
parent 71be716d76
commit 23a46bdcfb
2 changed files with 7 additions and 5 deletions

View File

@ -5,10 +5,10 @@ export type Txn = {
createdTime: number createdTime: number
fromId: string fromId: string
fromType: source_type fromType: SourceType
toId: string toId: string
toType: source_type toType: SourceType
amount: number amount: number
token: 'M$' // | 'USD' | MarketOutcome token: 'M$' // | 'USD' | MarketOutcome
@ -18,4 +18,4 @@ export type Txn = {
description?: string description?: string
} }
export type source_type = 'user' | 'contract' | 'charity' | 'bank' export type SourceType = 'USER' | 'CONTRACT' | 'CHARITY' | 'BANK'

View File

@ -151,9 +151,11 @@ function DonationBox(props: { user?: User | null; charity: Charity }) {
await transact({ await transact({
amount, amount,
fromId: user.id, fromId: user.id,
fromType: 'user', fromType: 'USER',
toId: charity.id, toId: charity.id,
toType: 'charity', toType: 'CHARITY',
token: 'M$',
category: 'CHARITY',
description: `${user.name} donated M$ ${amount} to ${charity.name}`, description: `${user.name} donated M$ ${amount} to ${charity.name}`,
}).catch((err) => console.log('Error', err)) }).catch((err) => console.log('Error', err))
setIsSubmitting(false) setIsSubmitting(false)