mirror of
https://github.com/spliit-app/spliit.git
synced 2025-12-06 09:29:39 +01:00
Prevent removing participants with expenses
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user