Skip to content

Commit

Permalink
explicitly select fields in fetch transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hbbb committed Jan 28, 2024
1 parent bec2b08 commit f9ed237
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion electron/main/models/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,35 @@ export async function fetchTransactions({
take: pageSize === Infinity ? undefined : pageSize,
skip: pageIndex === 0 ? 0 : pageIndex * pageSize,
where,
include: { account: true },
select: {
plaidId: true,
plaidAccountId: true,
date: true,
name: true,
amount: true,
category: true,
categoryIconUrl: true,
logoUrl: true,
merchantName: true,
address: true,
city: true,
state: true,
hidden: true,
account: {
select: {
plaidId: true,
name: true,
officialName: true,
type: true,
subtype: true,
mask: true,
currentBalance: true,
availableBalance: true,
isoCurrencyCode: true,
institutionPlaidId: true,
},
},
},
}),
prisma.transaction.count({ where }),
prisma.transaction.aggregate({ where, _sum: { amount: true } }),
Expand Down

0 comments on commit f9ed237

Please sign in to comment.