diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2023-12-11 10:26:13 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2023-12-11 10:26:13 -0500 |
| commit | 69fa008ea4e1a167e6076a69869388bf012d24b1 (patch) | |
| tree | 673fe0d20df27c59292bec8df38cff1bffd41947 /src/lib/api.ts | |
| parent | c504a773384bdaeddf6080ce749ecd39e12b24e5 (diff) | |
Tiny adjustments
Diffstat (limited to 'src/lib/api.ts')
| -rw-r--r-- | src/lib/api.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/api.ts b/src/lib/api.ts index b6a8d65..bde32e8 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -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( |
