Skip to content
Snippets Groups Projects
Commit 6b412d88 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

(make-recommendation): get collections after recommendation

parent 25384b30
No related branches found
No related tags found
1 merge request!10Sprint #12
...@@ -3,6 +3,7 @@ import { get } from 'lodash' ...@@ -3,6 +3,7 @@ import { get } from 'lodash'
import { Icon } from '@pubsweet/ui' import { Icon } from '@pubsweet/ui'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import styled from 'styled-components' import styled from 'styled-components'
import { actions } from 'pubsweet-client'
import { compose, withState, withHandlers } from 'recompose' import { compose, withState, withHandlers } from 'recompose'
import { getFormValues, reset as resetForm } from 'redux-form' import { getFormValues, reset as resetForm } from 'redux-form'
...@@ -57,8 +58,9 @@ export default compose( ...@@ -57,8 +58,9 @@ export default compose(
decision: get(getFormValues('recommendation')(state), 'decision'), decision: get(getFormValues('recommendation')(state), 'decision'),
}), }),
{ {
createRecommendation,
resetForm, resetForm,
createRecommendation,
getCollections: actions.getCollections,
}, },
), ),
withState('step', 'changeStep', 0), withState('step', 'changeStep', 0),
...@@ -75,11 +77,13 @@ export default compose( ...@@ -75,11 +77,13 @@ export default compose(
resetForm, resetForm,
fragmentId, fragmentId,
collectionId, collectionId,
getCollections,
createRecommendation, createRecommendation,
}) => values => { }) => values => {
const recommendation = utils.parseRecommendationValues(values) const recommendation = utils.parseRecommendationValues(values)
createRecommendation(collectionId, fragmentId, recommendation).then(r => { createRecommendation(collectionId, fragmentId, recommendation).then(r => {
resetForm('recommendation') resetForm('recommendation')
getCollections()
showModal({ showModal({
title: 'Recommendation sent', title: 'Recommendation sent',
}) })
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment