fix some lint errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface Number {
|
||||
pad(n: number, char?: string): string,
|
||||
durationify(): string
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
|
||||
export function displayFormErrors(error: any, form: HTMLElement|null = null) {
|
||||
export function displayFormErrors(error: ValidationErrors, form: HTMLElement|null = null) {
|
||||
if (error.response && error.response.status === 422) {
|
||||
let errors = error.response.data.errors
|
||||
const errors = error.response.data.errors
|
||||
const formBase = (form) ? form : document.body
|
||||
Object.keys(errors).forEach(key => {
|
||||
displayError(key, errors[key], formBase)
|
||||
Object.entries(errors).forEach(([key, value]) => {
|
||||
displayError(key, value, formBase)
|
||||
})
|
||||
// Object.keys(errors).forEach(key => {
|
||||
// displayError(key, errors[key], formBase)
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
interface ValidationErrors {
|
||||
response: {
|
||||
status: number,
|
||||
data: {
|
||||
errors: object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user