From 2c5da9b85e0686d367ee61d8ce287c85d666c48e Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Mon, 20 Jun 2022 22:40:35 +0200 Subject: [PATCH] Fix #90 - Blank page after deletion of all accounts --- resources/js/views/Accounts.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/js/views/Accounts.vue b/resources/js/views/Accounts.vue index daf0455e..b74ea485 100644 --- a/resources/js/views/Accounts.vue +++ b/resources/js/views/Accounts.vue @@ -405,9 +405,14 @@ let ids = [] this.selectedAccounts.forEach(id => ids.push(id)) - // Backend will delete all accounts at the same time + let that = this await this.axios.delete('/api/v1/twofaccounts?ids=' + ids.join()) - + .then(response => { + ids.forEach(function(id) { + that.accounts = that.accounts.filter(a => a.id !== id) + }) + }) + // we fetch the accounts again to prevent the js collection being // desynchronize from the backend php collection this.fetchAccounts(true)