aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/api.ts')
-rw-r--r--src/lib/api.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 4ae88ef..2968cae 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -66,6 +66,18 @@ export async function deleteExpense(expenseId: string) {
})
}
+export async function getGroupExpensesParticipants(groupId: string) {
+ const expenses = await getGroupExpenses(groupId)
+ return Array.from(
+ new Set(
+ expenses.flatMap((e) => [
+ e.paidById,
+ ...e.paidFor.map((pf) => pf.participantId),
+ ]),
+ ),
+ )
+}
+
export async function updateExpense(
groupId: string,
expenseId: string,