mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-24 08:26:13 +01:00
Add tRPC, use it for group expenses, balances and information page (#246)
* Add tRPC, use it for group expense list * Use tRPC for balances * Use tRPC in group information + better loading states
This commit is contained in:
committed by
GitHub
parent
727803ea5c
commit
66e15e419e
@@ -267,7 +267,7 @@ export async function getCategories() {
|
||||
|
||||
export async function getGroupExpenses(
|
||||
groupId: string,
|
||||
options?: { offset: number; length: number },
|
||||
options?: { offset?: number; length?: number; filter?: string },
|
||||
) {
|
||||
return prisma.expense.findMany({
|
||||
select: {
|
||||
@@ -287,7 +287,12 @@ export async function getGroupExpenses(
|
||||
splitMode: true,
|
||||
title: true,
|
||||
},
|
||||
where: { groupId },
|
||||
where: {
|
||||
groupId,
|
||||
title: options?.filter
|
||||
? { contains: options.filter, mode: 'insensitive' }
|
||||
: undefined,
|
||||
},
|
||||
orderBy: [{ expenseDate: 'desc' }, { createdAt: 'desc' }],
|
||||
skip: options && options.offset,
|
||||
take: options && options.length,
|
||||
|
||||
Reference in New Issue
Block a user