diff --git a/resources/js/helpers/form.ts b/resources/js/helpers/form.ts index 927f886..17d6fad 100644 --- a/resources/js/helpers/form.ts +++ b/resources/js/helpers/form.ts @@ -84,7 +84,7 @@ const defaultFormObject: FormObject = { if ( apiResponse.data && typeof apiResponse.data === "object" && - apiResponse.data.errors + "errors" in apiResponse.data ) { const errors = apiResponse.data.errors as Record; Object.keys(errors).forEach((key) => { @@ -116,7 +116,6 @@ const defaultFormObject: FormObject = { /** * Create a new Form object. - * * @param {Record} controls The controls included in the form. * @returns {FormObject} Returns a form object. */ @@ -177,7 +176,6 @@ export interface FormControlObject { /** * Create a new form control object. - * * @param {string} value The control name. * @param {ValidationObject | null} validator The control validation rules. * @returns {FormControlObject} The form control object.