Clear messages on success
This commit is contained in:
parent
c58ebd1751
commit
0bc9d45d0a
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue