Make API requests to edit note
This commit is contained in:
parent
1101305ffb
commit
9f51517ecd
4 changed files with 39 additions and 4 deletions
|
|
@ -6,7 +6,8 @@ const UserNote = {
|
|||
data () {
|
||||
return {
|
||||
localNote: '',
|
||||
editing: false
|
||||
editing: false,
|
||||
frozen: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -23,7 +24,19 @@ const UserNote = {
|
|||
this.editing = false
|
||||
},
|
||||
finalizeEditing () {
|
||||
this.editing = false
|
||||
this.frozen = true
|
||||
|
||||
this.$store.dispatch('editUserNote', {
|
||||
id: this.user.id,
|
||||
comment: this.localNote
|
||||
})
|
||||
.then(() => {
|
||||
this.frozen = false
|
||||
this.editing = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.frozen = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue