memos order by upated & fix created

This commit is contained in:
2020-05-02 11:17:49 +02:00
parent 033f563595
commit 5ccc5aa6c9
3 changed files with 13 additions and 4 deletions

View File

@@ -43,12 +43,20 @@ export default {
axios.get('/api/memos')
.then(response => {
this.memos = response.data.data
this.reorderList()
this.loading = false
})
.catch(() => {
this.loading = false
console.log('Unable to fetch memos.')
})
},
methods: {
reorderList() {
this.memos.sort(function(a, b) {
return a.data.last_updated_timestamp + b.data.last_updated_timestamp
})
}
}
}
</script>