Merge pull request #2914 from EnesSacid-Buker/master

this.errors is undefined issue
This commit is contained in:
Cüneyt Şentürk 2023-03-01 17:47:55 +03:00 committed by GitHub
commit 6015e3a1e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View File

@ -17,14 +17,16 @@ export default class Errors {
} }
get(field) { get(field) {
if (this.errors[field]) { if (this.has(field)) {
return this.errors[field][0]; return this.errors[field][0];
} }
} }
record(errors) { record(errors) {
if (errors instanceof Object) {
this.errors = errors; this.errors = errors;
} }
}
clear(field) { clear(field) {
if (field) { if (field) {