Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/donations: Fix donation filter query #612

Merged
merged 7 commits into from
Mar 22, 2024
10 changes: 7 additions & 3 deletions apps/api/src/donations/donations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,15 @@ export class DonationsService {
lte: to,
},
paymentId: paymentId,
payment: {
slavcho marked this conversation as resolved.
Show resolved Hide resolved
status: paymentStatus,
provider: paymentProvider,
},
OR: [
{ payment: { status: paymentStatus } },
{ payment: { provider: paymentProvider } },
{ payment: { billingEmail: { contains: search } } },
{ payment: { billingName: { contains: search } } },
{ person: { firstName: { contains: search } } },
{ person: { lastName: { contains: search } } },
],
targetVault: { campaign: { id: campaignId } },
})
Expand Down Expand Up @@ -431,7 +435,7 @@ export class DonationsService {
pageSize?: number,
): Promise<ListDonationsDto<PaymentWithDonationCount>> {
const whereClause = Prisma.validator<Prisma.PaymentWhereInput>()({
// id: paymentId,
id: paymentId,
amount: {
gte: minAmount,
lte: maxAmount,
Expand Down
Loading