From 27f51e35bf732667e4e6015fb76f7fd6871e41cd Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 26 Mar 2021 02:32:19 +0300 Subject: fix: add sample id so that key is generated --- src/hooks/useAPIClient.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts index c7e8d31..3035c51 100644 --- a/src/hooks/useAPIClient.ts +++ b/src/hooks/useAPIClient.ts @@ -35,6 +35,7 @@ hooks.account = { const { data: transfers } = useSWR('/transfers', fetcher); const dates = _.groupBy(transfers, 'date'); const dataUnsorted = _.map(dates, (dateTransfers, date) => ({ + _id: dateTransfers[0]._id, // fake: sample id for unique key date, amount: _ .sumBy(dateTransfers, transfer => transfer.amount * (transfer.operation === 'in' ? 1 : -1)) -- cgit v1.2.3