aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/user_note/user_note.js17
-rw-r--r--src/components/user_note/user_note.vue5
2 files changed, 18 insertions, 4 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
+ })
}
}
}
diff --git a/src/components/user_note/user_note.vue b/src/components/user_note/user_note.vue
index 46db1ca7..a8f3fb10 100644
--- a/src/components/user_note/user_note.vue
+++ b/src/components/user_note/user_note.vue
@@ -15,6 +15,7 @@
<button
v-show="editing"
class="button-default btn"
+ :disabled="frozen"
@click="finalizeEditing"
>
{{ $t('user_card.edit_note_apply') }}
@@ -22,6 +23,7 @@
<button
v-show="editing"
class="button-default btn"
+ :disabled="frozen"
@click="cancelEditing"
>
{{ $t('user_card.edit_note_cancel') }}
@@ -30,9 +32,8 @@
</div>
<input
v-show="editing"
+ v-model="localNote"
class="note-text"
- type="string"
- :model="localNote"
>
<span
v-show="!editing"