aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_note/user_note.js
blob: 6a4798009cb6081533bb2b1f6c6641b56398a376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const UserNote = {
  props: {
    user: Object,
    relationship: Object
  },
  data () {
    return {
      localNote: '',
      editing: false
    }
  },
  computed: {
    shouldShow () {
      return this.relationship.note || this.editing
    }
  },
  methods: {
    startEditing () {
      this.localNote = this.relationship.note
      this.editing = true
    },
    cancelEditing () {
      this.editing = false
    },
    finalizeEditing () {
      this.editing = false
    }
  }
}

export default UserNote