aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_note/user_note.js
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-08-20 13:18:57 -0400
committertusooa <tusooa@kazv.moe>2022-12-21 23:17:39 -0500
commit9f51517ecdee7de0e9288eb94e6ecf70fd161eb3 (patch)
treec058096b6d7468ad9c7101548fa9189d695fede0 /src/components/user_note/user_note.js
parent1101305ffb72bacd68698bfbe6e961953a9043de (diff)
Make API requests to edit note
Diffstat (limited to 'src/components/user_note/user_note.js')
-rw-r--r--src/components/user_note/user_note.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/components/user_note/user_note.js b/src/components/user_note/user_note.js
index 6a479800..dc5b8e71 100644
--- a/src/components/user_note/user_note.js
+++ b/src/components/user_note/user_note.js
@@ -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
+ })
}
}
}