Namespace overview now does only one request instead of one for each namespace to get all lists

This commit is contained in:
kolaente 2018-09-17 07:34:22 +02:00
parent 17a8f47572
commit 3bc535577c
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 18 deletions

View File

@ -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 => {