Handle errors while querying notes

This commit is contained in:
2020-04-25 22:46:43 +02:00
parent c1fabe943c
commit 86ec7f4de8
2 changed files with 19 additions and 10 deletions
+13 -5
View File
@@ -74,14 +74,22 @@ export default {
},
methods: {
async loadNotes() {
await this.$axios.get('/notes').then((e) => {
this.notes = e.data
this.loading = false
})
await this.$axios
.get('/notes')
.then((e) => {
this.notes = e.data
this.loading = false
})
.catch((_) => {})
},
editItem(item) {},
async deleteItem(item) {
await this.$axios.delete(`/notes/${item.uuid}`).then(this.loadNotes)
try {
await this.$axios.delete(`/notes/${item.uuid}`)
} catch (_) {
} finally {
await this.loadNotes()
}
},
format,
},