Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const GeneralEnquiryForm = compose(
- mapProps(props => Object.assign({}, props, props.conf, { mapDataToSubmit, mapDataToSubscribe })),
- withRemoteSubmit(props => props.endpoint ? props.endpoint : '//data.fclmedia.com/sendEnquiry', 'GET', 'submitEnquiry'),
- withRemoteSubmit(props => props.subscribeEndpoint ? props.subscribeEndpoint : '/api/external_endpoint/salesforce_subscribe', 'GET', 'subscribe'),
- withFlatModel(enquiryModel, modelTransforms),
- withEventListener('react-form-update.form.enquiry.general', (data, props) => {
- Object.keys(data).map(key => {
- let newValue = data[key];
- // We cannot directly map return date or depart date because it
- // may come through in an alternate format.
- if (key === 'returnDate' || key === 'departDate') {
- newValue = checkDate(newValue, today);
- }
- props.updateModelField(key, newValue);
- });
- }),
- withEventListener('SELECTED_TILE', (data, props) => {
- Object.keys(data).map(key => {
- let newValue = data[key];
- props.updateModelField(key, newValue);
- });
- })
- )(BaseEnquiryForm);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement