Handle errors while querying notes
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user