From 9a7316b795a4f2e4523528ac62808b8903c47dc1 Mon Sep 17 00:00:00 2001 From: manel Date: Sun, 14 Jan 2024 14:35:54 +0100 Subject: [PATCH] Refactor --- resources/js/Pages/Dashboard.vue | 5 +---- resources/js/tests/dashboard.test.js | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index cd0ba2d..037f5f2 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -293,11 +293,8 @@ } data.balances.forEach(newToken => { - const token = this.tokens[0][newToken.pool] + this.tokens[0][newToken.pool] = newToken - token.price = newToken.price - token.balance = newToken.balance - token.price_eur = newToken.price_eur this.totals.usd += newToken.price * newToken.balance this.totals.eur += newToken.price_eur * newToken.balance this.totals.eth += newToken.price * newToken.balance / this.totals.pricesUsd diff --git a/resources/js/tests/dashboard.test.js b/resources/js/tests/dashboard.test.js index c73e123..7ea86d9 100644 --- a/resources/js/tests/dashboard.test.js +++ b/resources/js/tests/dashboard.test.js @@ -162,7 +162,6 @@ it('refreshes_the_tokens', async () => { "price": 20, "balance": 10, "price_eur": 19, - "pool": "Token 1", - "created_at": "now" + "pool": "Token 1" }) })