From 3bc535577c8f01b89789a00368d8fd0471db8654 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 17 Sep 2018 07:34:22 +0200 Subject: [PATCH] Namespace overview now does only one request instead of one for each namespace to get all lists --- src/App.vue | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/App.vue b/src/App.vue index e04209c5c..6e393449a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -113,24 +113,7 @@ this.namespaces = [] HTTP.get(`namespaces`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) .then(response => { - - let nps = response.data - - // Loop through the namespaces and get their lists - for (const n in nps) { - - this.namespaces.push(nps[n]) - - HTTP.get(`namespaces/` + nps[n].id + `/lists`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) - .then(response => { - // This adds a new element "list" to our object which contains all lists - this.$set(this.namespaces[n], 'lists', response.data) - }) - .catch(e => { - this.handleError(e) - }) - } - + this.$set(this, 'namespaces', response.data) this.loading = false }) .catch(e => {