import FormAnalytics from '../../plugins/Form/Analytics' ; const asyncFormEntryCreate = ( { mobilizationId , formEntry , } ) => ( _dispatch , _getState , { api } ) => { const endpoint = `/mobilizations/${ mobilizationId }/form_entries` ; const body = { form_entry : formEntry } ; return api . post ( endpoint , body ) . then ( ( { data } ) => { FormAnalytics . formSavedData ( ) ; return Promise . resolve ( data ) ; } ) . catch ( ( failure ) => { return Promise . reject ( { _error : `Response ${ failure }` } ) ; } ) ; } ; export default asyncFormEntryCreate ;