From b55b99a82c9167259fc4e5e7d5c9cf07a6fd5244 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 7 Sep 2018 22:44:07 +0200 Subject: [PATCH] Fixed namespace nav --- src/App.vue | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index a94b015f3..90959d617 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,19 +9,21 @@
+
@@ -61,16 +63,17 @@ HTTP.get(`namespaces`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) .then(response => { - let namespaces = response.data + let nps = response.data - // Get the lists - for (const n in namespaces) { + // Loop through the namespaces and get their lists + for (const n in nps) { - this.namespaces[n] = namespaces[n] + this.namespaces.push(nps[n]) - HTTP.get(`namespaces/` + namespaces[n].id + `/lists`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) + HTTP.get(`namespaces/` + nps[n].id + `/lists`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}}) .then(response => { - this.namespaces[n].lists = response.data + // This adds a new element "list" to our object which contains all lists + this.$set(this.namespaces[n], 'lists', response.data) }) .catch(e => { this.loading = false @@ -79,9 +82,6 @@ }) } - // eslint-disable-next-line - console.log(this.namespaces) - this.loading = false }) .catch(e => {