Move fname/firstName and lname/lastName renaming in thunk functions

This commit is contained in:
Vesa Luusua 2019-03-21 22:42:51 +02:00
parent 59f5e08897
commit f1b7a2235d
2 changed files with 2 additions and 8 deletions

View file

@ -172,9 +172,8 @@ class EditListingWizard extends Component {
}
handlePayoutSubmit(values) {
const { fname: firstName, lname: lastName, ...rest } = values;
this.props
.onPayoutDetailsSubmit({ firstName, lastName, ...rest })
.onPayoutDetailsSubmit(values)
.then(() => {
this.setState({ showPayoutDetails: false });
this.props.onManageDisableScrolling('EditListingWizard.payoutModal', false);

View file

@ -76,11 +76,6 @@ export const PayoutPreferencesPageComponent = props => {
message = <FormattedMessage id="PayoutPreferencesPage.stripeNotConnected" />;
}
const handlePayoutDetailsSubmit = values => {
const { fname: firstName, lname: lastName, ...rest } = values;
onPayoutDetailsFormSubmit({ firstName, lastName, ...rest });
};
const showForm =
currentUserLoaded && (payoutDetailsSaveInProgress || payoutDetailsSaved || !stripeConnected);
const form = showForm ? (
@ -91,7 +86,7 @@ export const PayoutPreferencesPageComponent = props => {
submitButtonText={intl.formatMessage({ id: 'PayoutPreferencesPage.submitButtonText' })}
createStripeAccountError={createStripeAccountError}
onChange={onPayoutDetailsFormChange}
onSubmit={handlePayoutDetailsSubmit}
onSubmit={onPayoutDetailsFormSubmit}
/>
) : null;