Return ajv errors from validate method.
This commit is contained in:
@@ -2,6 +2,7 @@ import Ajv, { type ValidateFunction } from 'ajv';
|
||||
import addFormats from 'ajv-formats';
|
||||
|
||||
const ajv = new Ajv({
|
||||
allErrors: true,
|
||||
coerceTypes: true,
|
||||
});
|
||||
addFormats(ajv);
|
||||
@@ -239,7 +240,7 @@ export class Declaform extends HTMLElement {
|
||||
}
|
||||
const obj = this.toObject();
|
||||
const isValid = this._validate(obj);
|
||||
return isValid;
|
||||
return this._validate.errors;
|
||||
}
|
||||
|
||||
private async hydrateFromEndpoint(endpoint: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user