Clear messages on success

This commit is contained in:
Oliver Davies 2019-06-04 22:40:05 +01:00
parent c58ebd1751
commit 0bc9d45d0a

View file

@ -84,12 +84,14 @@ export default {
.then(({ data }) => { .then(({ data }) => {
const title = data.data.attributes.title const title = data.data.attributes.title
this.messages.push(`Session ${title} has been created.`) this.messages.push(`Session ${title} has been created.`)
this.errors = []
this.$emit('submitted', data.data) this.$emit('submitted', data.data)
this.form.body = '' this.form.body = ''
this.form.title = '' this.form.title = ''
this.errors = []
this.messages = []
}) })
.catch(error => { .catch(error => {
this.errors = _(error.response.data.errors).map('detail').value() this.errors = _(error.response.data.errors).map('detail').value()