validation now async

This commit is contained in:
2023-02-21 09:06:28 +10:00
parent cd689ea1a8
commit 2ee1bd3658
2 changed files with 13 additions and 11 deletions

View File

@@ -10,12 +10,12 @@ export const FormObject = (controls) => {
const keys = item ? [item] : Object.keys(this);
let valid = true;
keys.every((key) => {
keys.every(async (key) => {
if (
typeof this[key] == "object" &&
Object.keys(this[key]).includes("validation")
) {
this[key].validation.result = this[
this[key].validation.result = await this[
key
].validation.validator.validate(this[key].value);