Skip to content

Commit a4d0633

Browse files
authored
Merge pull request #47 from topcoder-platform/PM-1194_fix-filtering
PM-1194 - Fix filtering by status
2 parents 7841e86 + 2e6e200 commit a4d0633

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api/repository/winnings.repo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ export class WinningsRepository {
202202
this.prisma.winnings.count({ where: queryWhere }),
203203
]);
204204

205-
const usersPayoutStatusMap =
206-
await this.getUsersPayoutStatusForWinnings(winnings);
205+
const usersPayoutStatusMap = winnings?.length
206+
? await this.getUsersPayoutStatusForWinnings(winnings)
207+
: ({} as { [key: string]: payment_status });
207208

208209
result.data = {
209210
winnings: winnings.map((item) => ({

0 commit comments

Comments
 (0)