mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-12 14:52:23 +05:30
#366: properly handle the case, when password confirmation is succeed, but parent form has errors
This commit is contained in:
parent
4afbbd0efb
commit
957bed17c6
@ -125,7 +125,11 @@ export default connect(null, {
|
||||
if (resp.errors) {
|
||||
form.setErrors(resp.errors);
|
||||
|
||||
if (Object.keys(resp.errors).length > 1) {
|
||||
const parentFormHasErrors = Object.keys(resp.errors)
|
||||
.filter((name) => name !== 'password')
|
||||
.length > 0;
|
||||
|
||||
if (parentFormHasErrors) {
|
||||
// something wrong with parent form, hidding popup and show that form
|
||||
props.onClose();
|
||||
reject(resp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user