Description
Multiple error messages are coming when using Async Validator.
Version of Vue-form-Generator used : 2.3.4
Issue : One custom async validator is added to the field and API is integrated on that validator but on every key press if field is invalid, error messages keeps pushing into the array and though multiple error messages are coming below field.
Expectation : On key press if error already exists in the array, it should not be pushed again.
Example :
isNameExists(value) {
return await new Promise((resolve) => {
HTTP.get("/nameExits=" + value)
.then((response) => {
resolve(["Name not exists"]);
})
.catch((e) => {
resolve();
this.errors.push(e);
});
});
},
isNameExists is custom validator. Error message "Name not exists" keeps on repeating".
Note : Error keeps on repeating in slow network, for fast network it is working fine.
@icebob Please look into this.
Thanks in advance