From 58ee685e22c705d5ad8b1a2da9e4ab7e6106ec3c Mon Sep 17 00:00:00 2001
From: Mert Demir <mertd@users.noreply.github.com>
Date: Sat, 27 Jan 2024 00:26:58 +0900
Subject: paid for all, split evenly (#59)

---
 src/components/expense-form.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/components/expense-form.tsx')

diff --git a/src/components/expense-form.tsx b/src/components/expense-form.tsx
index 035d22c..92e24d0 100644
--- a/src/components/expense-form.tsx
+++ b/src/components/expense-form.tsx
@@ -106,7 +106,11 @@ export function ExpenseForm({
           expenseDate: new Date(),
           amount: 0,
           category: 0, // category with Id 0 is General
-          paidFor: [],
+          // paid for all, split evenly
+          paidFor: group.participants.map(({ id }) => ({
+            participant: id,
+            shares: 1,
+          })),
           paidBy: getSelectedPayer(),
           isReimbursement: false,
           splitMode: 'EVENLY',
-- 
cgit v1.3

