From 02e8f0e0ac95d21688ab4b5efa25ee52a5251f8d Mon Sep 17 00:00:00 2001 From: hatim boufnichel Date: Fri, 2 Apr 2021 20:42:25 +0200 Subject: [PATCH] reverse and filter --- src/routes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes.js b/src/routes.js index 374d487b..3037f99f 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1273,17 +1273,17 @@ module.exports = async ( res.json({ transactions: getListPage({ - entries: transactions, + entries: transactions.reverse(), itemsPerPage, page }), payments: getListPage({ - entries: payments, + entries: payments.reverse(), itemsPerPage, page }), invoices: { - content: invoices, + content: invoices.filter(invoice => invoice.settled), page, totalPages: Math.ceil(last_index_offset / itemsPerPage), totalItems: last_index_offset