Redesign the groups page

This commit is contained in:
Sebastien Castiel
2023-12-07 20:54:11 -05:00
parent 6f077f141e
commit 0e7b879aa8
4 changed files with 86 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
import { getPrisma } from '@/lib/prisma'
import { ExpenseFormValues, GroupFormValues } from '@/lib/schemas'
import { delay } from '@/lib/utils'
import { Expense } from '@prisma/client'
import { v4 as uuidv4 } from 'uuid'
@@ -78,6 +79,15 @@ export async function getGroupExpensesParticipants(groupId: string) {
)
}
export async function getGroups(groupIds: string[]) {
await delay(2000)
const prisma = await getPrisma()
return prisma.group.findMany({
where: { id: { in: groupIds } },
include: { _count: { select: { participants: true } } },
})
}
export async function updateExpense(
groupId: string,
expenseId: string,