reverse and filter
This commit is contained in:
parent
d8102a3377
commit
02e8f0e0ac
1 changed files with 3 additions and 3 deletions
|
|
@ -1273,17 +1273,17 @@ module.exports = async (
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
transactions: getListPage({
|
transactions: getListPage({
|
||||||
entries: transactions,
|
entries: transactions.reverse(),
|
||||||
itemsPerPage,
|
itemsPerPage,
|
||||||
page
|
page
|
||||||
}),
|
}),
|
||||||
payments: getListPage({
|
payments: getListPage({
|
||||||
entries: payments,
|
entries: payments.reverse(),
|
||||||
itemsPerPage,
|
itemsPerPage,
|
||||||
page
|
page
|
||||||
}),
|
}),
|
||||||
invoices: {
|
invoices: {
|
||||||
content: invoices,
|
content: invoices.filter(invoice => invoice.settled),
|
||||||
page,
|
page,
|
||||||
totalPages: Math.ceil(last_index_offset / itemsPerPage),
|
totalPages: Math.ceil(last_index_offset / itemsPerPage),
|
||||||
totalItems: last_index_offset
|
totalItems: last_index_offset
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue