Clear messages on success
This commit is contained in:
parent
c58ebd1751
commit
0bc9d45d0a
|
@ -84,12 +84,14 @@ export default {
|
|||
.then(({ data }) => {
|
||||
const title = data.data.attributes.title
|
||||
this.messages.push(`Session ${title} has been created.`)
|
||||
this.errors = []
|
||||
|
||||
this.$emit('submitted', data.data)
|
||||
|
||||
this.form.body = ''
|
||||
this.form.title = ''
|
||||
|
||||
this.errors = []
|
||||
this.messages = []
|
||||
})
|
||||
.catch(error => {
|
||||
this.errors = _(error.response.data.errors).map('detail').value()
|
||||
|
|
Loading…
Reference in a new issue