Skip to content
Snippets Groups Projects
Commit d23abecf authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add alert message when note is empty

parent b949ddae
Branches
Tags
1 merge request!11Add ability to read reports
......@@ -55,10 +55,14 @@ export default {
this.$data.showNewNoteInput = !this.$data.showNewNoteInput
},
addNewNote(reportId) {
const currentUserNickname = this.$store.state.user.name
const note = { author: currentUserNickname, text: this.$data.note, timestamp: '2019/04/01' }
this.$store.dispatch('AddNote', { reportId, note })
this.$data.note = ''
if (this.$data.note.length < 2) {
this.$message('Note must contain at least 2 characters')
} else {
const currentUserNickname = this.$store.state.user.name
const note = { author: currentUserNickname, text: this.$data.note, timestamp: '2019/04/01' }
this.$store.dispatch('AddNote', { reportId, note })
this.$data.note = ''
}
},
deleteNote(reportId, noteId) {
this.$confirm(i18n.t('reports.confirmMsg'), {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment