From 87b9bf7fe8bd811a69e4b1d998d5b536e609cf2c Mon Sep 17 00:00:00 2001 From: G Date: Fri, 7 Jun 2024 12:01:04 +0000 Subject: [PATCH] manually reversing the array while waiting for backend to do that. --- src/hooks/useTransactionsHistory.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/useTransactionsHistory.tsx b/src/hooks/useTransactionsHistory.tsx index 8516c99..4420008 100644 --- a/src/hooks/useTransactionsHistory.tsx +++ b/src/hooks/useTransactionsHistory.tsx @@ -18,7 +18,10 @@ const useTransactionsHistory = () => { const filterByReference = useCallback( (reference: string) => { if (!data?.length) return []; - return data.filter((transaction) => transaction.reference.includes(reference)); + // TODO: Update this when the api is fixed + const reversed = data.reverse(); + + return reversed.filter((transaction) => transaction.reference.includes(reference)); }, [data], ); -- libgit2 0.27.1