From 69fa008ea4e1a167e6076a69869388bf012d24b1 Mon Sep 17 00:00:00 2001 From: Sebastien Castiel Date: Mon, 11 Dec 2023 10:26:13 -0500 Subject: Tiny adjustments --- src/lib/api.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/api.ts') 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( -- cgit v1.3