1
0
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:
Kyle Spearrin 2017-12-11 12:04:18 -05:00
parent 4bcc1653ac
commit fd35529f38

View File

@ -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) {