Tiny adjustments

This commit is contained in:
Sebastien Castiel
2023-12-11 10:26:13 -05:00
parent c504a77338
commit 69fa008ea4
6 changed files with 42 additions and 19 deletions

View File

@@ -83,10 +83,13 @@ export async function getGroupExpensesParticipants(groupId: string) {
export async function getGroups(groupIds: string[]) {
const prisma = await getPrisma()
return prisma.group.findMany({
return (await prisma.group.findMany({
where: { id: { in: groupIds } },
include: { _count: { select: { participants: true } } },
})
})).map(group => ({
...group,
createdAt: group.createdAt.toISOString()
}))
}
export async function updateExpense(