aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsashkent3 <33320473+sashkent3@users.noreply.github.com>2024-02-28 19:58:49 +0400
committerGitHub <noreply@github.com>2024-02-28 10:58:49 -0500
commit6a5efc5f3fa55b58489f88d82694e1a893439514 (patch)
treee14bec28f14b27a4ff803fd5bf096c36f95ce056
parent4c5f8a6aa55f52e70f3181b06967e5351695c731 (diff)
Fix the default value for the expense shares field (#113)
* fix default shares value * fix default shares value for reimbursements * prettier
-rw-r--r--src/components/expense-form.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/expense-form.tsx b/src/components/expense-form.tsx
index 84fe7c5..d8b63a8 100644
--- a/src/components/expense-form.tsx
+++ b/src/components/expense-form.tsx
@@ -114,7 +114,10 @@ export function ExpenseForm({
paidBy: searchParams.get('from') ?? undefined,
paidFor: [
searchParams.get('to')
- ? { participant: searchParams.get('to')!, shares: 1 }
+ ? {
+ participant: searchParams.get('to')!,
+ shares: '1' as unknown as number,
+ }
: undefined,
],
isReimbursement: true,
@@ -133,7 +136,7 @@ export function ExpenseForm({
// paid for all, split evenly
paidFor: group.participants.map(({ id }) => ({
participant: id,
- shares: 1,
+ shares: '1' as unknown as number,
})),
paidBy: getSelectedPayer(),
isReimbursement: false,