Skip to content

Commit 3b3ec1a

Browse files
committed
Fix react es6 01 sample
1 parent 2190f9b commit 3b3ec1a

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

samples/react/es6/00 SimpleForm/src/reducers/customer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function customerSaveCompleted(state, action) {
4646
return {
4747
...state,
4848
customerErrors: {
49+
...state.customerErrors,
4950
...action.formValidationResult.fieldErrors,
5051
},
5152
};

samples/react/es6/01 SignupForm/src/reducers/signup.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@ function signupProcessCompleted(state, action) {
4343
}
4444

4545
function performSignupCompleted(state, action) {
46-
const newSignupErrors = { ...state.signupErrors };
47-
48-
action.formValidationResult.fieldErrors.forEach(fieldValidationResult => {
49-
newSignupErrors[fieldValidationResult.key] = fieldValidationResult;
50-
});
51-
5246
return {
5347
...state,
54-
signupErrors: newSignupErrors
48+
signupErrors: {
49+
...state.signupErrors,
50+
...action.formValidationResult.fieldErrors,
51+
},
5552
};
5653
}

0 commit comments

Comments
 (0)