diff options
-rw-r--r-- | src/hooks/useAPIClient.ts | 1 |
1 files changed, 1 insertions, 0 deletions
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)) |