From 23a46bdcfb89bdfcb3aa354bc457f8ff92a3c220 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 29 Apr 2022 11:38:22 -0400 Subject: [PATCH] Fix breakages --- common/txn.ts | 6 +++--- web/pages/charity/[charitySlug].tsx | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/txn.ts b/common/txn.ts index 6f1f5415..8beea234 100644 --- a/common/txn.ts +++ b/common/txn.ts @@ -5,10 +5,10 @@ export type Txn = { createdTime: number fromId: string - fromType: source_type + fromType: SourceType toId: string - toType: source_type + toType: SourceType amount: number token: 'M$' // | 'USD' | MarketOutcome @@ -18,4 +18,4 @@ export type Txn = { description?: string } -export type source_type = 'user' | 'contract' | 'charity' | 'bank' +export type SourceType = 'USER' | 'CONTRACT' | 'CHARITY' | 'BANK' diff --git a/web/pages/charity/[charitySlug].tsx b/web/pages/charity/[charitySlug].tsx index 78f4ec13..e358f4e1 100644 --- a/web/pages/charity/[charitySlug].tsx +++ b/web/pages/charity/[charitySlug].tsx @@ -151,9 +151,11 @@ function DonationBox(props: { user?: User | null; charity: Charity }) { await transact({ amount, fromId: user.id, - fromType: 'user', + fromType: 'USER', toId: charity.id, - toType: 'charity', + toType: 'CHARITY', + token: 'M$', + category: 'CHARITY', description: `${user.name} donated M$ ${amount} to ${charity.name}`, }).catch((err) => console.log('Error', err)) setIsSubmitting(false)