summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/mixins/note_form.js
blob: b74879f2256672e675b6fa776190842b0377466a (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
export default {
  data() {
    return {
      showBatchCommentsActions: false,
    };
  },
  methods: {
    handleKeySubmit() {
      this.handleUpdate();
    },
    handleUpdate(shouldResolve) {
      const beforeSubmitDiscussionState = this.discussionResolved;
      this.isSubmitting = true;

      this.$emit('handleFormUpdate', this.updatedNoteBody, this.$refs.editNoteForm, () => {
        this.isSubmitting = false;

        if (this.shouldToggleResolved(shouldResolve, beforeSubmitDiscussionState)) {
          this.resolveHandler(beforeSubmitDiscussionState);
        }
      });
    },
  },
};