Namespace overview now does only one request instead of one for each namespace to get all lists
This commit is contained in:
parent
17a8f47572
commit
3bc535577c
1 changed files with 1 additions and 18 deletions
19
src/App.vue
19
src/App.vue
|
@ -113,24 +113,7 @@
|
||||||
this.namespaces = []
|
this.namespaces = []
|
||||||
HTTP.get(`namespaces`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
|
HTTP.get(`namespaces`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
this.$set(this, 'namespaces', response.data)
|
||||||
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.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|
Loading…
Reference in a new issue