summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-26 02:32:19 +0300
committereug-vs <eug-vs@keemail.me>2021-03-26 02:32:19 +0300
commit27f51e35bf732667e4e6015fb76f7fd6871e41cd (patch)
tree51a786428f9afd69a41afcbe23df34a9e9c5d125
parent907da06c18b8219f774459f7810116009709e0c1 (diff)
downloadcommercel-ui-27f51e35bf732667e4e6015fb76f7fd6871e41cd.tar.gz
fix: add sample id so that key is generated
-rw-r--r--src/hooks/useAPIClient.ts1
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))