clear errors on item edition page

This commit is contained in:
eduardohumberto 2018-05-04 22:56:38 -03:00
parent d3c706d103
commit f6ff171c90
2 changed files with 101 additions and 98 deletions

View File

@ -529,6 +529,8 @@ export default {
created(){ created(){
// Obtains collection ID // Obtains collection ID
this.cleanFields(); this.cleanFields();
eventBus.clearAllErrors();
this.formErrorMessage = '';
this.collectionId = this.$route.params.collectionId; this.collectionId = this.$route.params.collectionId;
this.form.collectionId = this.collectionId; this.form.collectionId = this.collectionId;
@ -682,5 +684,3 @@ export default {
</style> </style>

View File

@ -66,6 +66,9 @@ export const eventBus = new Vue({
let error = this.errors.find( errorItem => errorItem.field_id == field_id ); let error = this.errors.find( errorItem => errorItem.field_id == field_id );
return ( error ) ? error.errors : false return ( error ) ? error.errors : false
}, },
clearAllErrors(){
this.errors = [];
},
setValues(){ setValues(){
const field = this.$store.getters['item/getMetadata']; const field = this.$store.getters['item/getMetadata'];
if( field ){ if( field ){