update: add to query to the invoice search for ademin
This commit is contained in:
@@ -50,6 +50,12 @@ export class InvoicesRepository extends Repository<Invoice> {
|
||||
});
|
||||
}
|
||||
|
||||
if (queryDto.to) {
|
||||
queryBuilder.andWhere("(invoice.createdAt <= :to OR invoice.dueDate <= :to OR invoice.paidAt <= :to)", {
|
||||
to: new Date(queryDto.to),
|
||||
});
|
||||
}
|
||||
|
||||
queryBuilder.orderBy("invoice.createdAt", "DESC");
|
||||
queryBuilder.skip(skip);
|
||||
queryBuilder.take(limit);
|
||||
|
||||
Reference in New Issue
Block a user