try tu update
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// @ts-expect-error use import var
|
||||
export const env: envProps = import.meta.env
|
||||
|
||||
|
||||
interface envProps {
|
||||
BASE_URL: string,
|
||||
DEV: boolean,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import {AxiosError} from "axios"
|
||||
|
||||
export function displayFormErrors(error: ValidationErrors, form: HTMLElement|null = null) {
|
||||
export function displayFormErrors(error: ValidationErrors|AxiosError, form: HTMLElement|null = null) {
|
||||
if (error.response && error.response.status === 422) {
|
||||
// @ts-ignore
|
||||
const errors = error.response.data.errors
|
||||
const formBase = (form) ? form : document.body
|
||||
Object.entries(errors).forEach(([key, value]) => {
|
||||
|
||||
Reference in New Issue
Block a user