Fixed "data is null" when showing tasks when there wouldn't exist any
This commit is contained in:
parent
f8fb60a004
commit
830c5ef075
1 changed files with 6 additions and 4 deletions
|
@ -62,12 +62,14 @@
|
||||||
HTTP.get(url, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
|
HTTP.get(url, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// Filter all done tasks
|
// Filter all done tasks
|
||||||
|
if (response.data !== null) {
|
||||||
for (const index in response.data) {
|
for (const index in response.data) {
|
||||||
if (response.data[index].done !== true) {
|
if (response.data[index].done !== true) {
|
||||||
this.hasUndoneTasks = true
|
this.hasUndoneTasks = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response.data.sort(this.sortyByDeadline)
|
response.data.sort(this.sortyByDeadline)
|
||||||
|
}
|
||||||
this.$set(this, 'tasks', response.data)
|
this.$set(this, 'tasks', response.data)
|
||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue