Skip to content

Commit

Permalink
Fix the default value for the expense shares field (#113)
Browse files Browse the repository at this point in the history
* fix default shares value

* fix default shares value for reimbursements

* prettier
  • Loading branch information
sashkent3 authored Feb 28, 2024
1 parent 4c5f8a6 commit 6a5efc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/expense-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6a5efc5

Please sign in to comment.