mirror of
https://github.com/bitwarden/browser
synced 2025-01-08 00:17:06 +01:00
fix bug for iterating validationErrors
This commit is contained in:
parent
4bcc1653ac
commit
fd35529f38
@ -13,11 +13,15 @@ export class ValidationService {
|
|||||||
} else if (!data.validationErrors) {
|
} else if (!data.validationErrors) {
|
||||||
errors.push(data.message ? data.message : defaultErrorMessage);
|
errors.push(data.message ? data.message : defaultErrorMessage);
|
||||||
} else {
|
} else {
|
||||||
data.validationErrors.forEach((error: any) => {
|
for (const key in data.validationErrors) {
|
||||||
error.forEach((item: string) => {
|
if (!data.validationErrors.hasOwnProperty(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.validationErrors[key].forEach((item: string) => {
|
||||||
errors.push(item);
|
errors.push(item);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errors.length) {
|
if (errors.length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user