find all payments
This commit is contained in:
@@ -25,7 +25,8 @@ export class PaymentRepository extends EntityRepository<Payment> {
|
||||
order = 'desc',
|
||||
userId,
|
||||
from,
|
||||
to
|
||||
to,
|
||||
orderId
|
||||
} = opts;
|
||||
|
||||
const offset = (page - 1) * limit;
|
||||
@@ -53,6 +54,9 @@ export class PaymentRepository extends EntityRepository<Payment> {
|
||||
where.order = { user: { id: userId } };
|
||||
}
|
||||
|
||||
if (orderId) {
|
||||
where.order = { id: orderId }
|
||||
}
|
||||
// Filter by date range
|
||||
if (from || to) {
|
||||
where.createdAt = {};
|
||||
|
||||
Reference in New Issue
Block a user