We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e728303 commit 76580eeCopy full SHA for 76580ee
src/server/api/routers/group.ts
@@ -81,11 +81,7 @@ export const groupRouter = createTRPCRouter({
81
const balances: Record<string, number> = {};
82
83
for (const balance of g.group.groupBalances) {
84
- if (balances[balance.currency] === undefined) {
85
- balances[balance.currency] = balance.amount;
86
- } else {
87
- balances[balance.currency] += balance.amount;
88
- }
+ balances[balance.currency] = (balances[balance.currency] ?? 0) + balance.amount;
89
}
90
91
return {
@@ -234,6 +230,7 @@ export const groupRouter = createTRPCRouter({
234
230
},
235
231
where: {
236
232
groupId: input.groupId,
233
+ deletedAt: null,
237
238
});
239
0 commit comments