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'
import { Icon } from '@pubsweet/ui'
import { connect } from 'react-redux'
import styled from 'styled-components'
import { actions } from 'pubsweet-client'
import { compose, withState, withHandlers } from 'recompose'
import { getFormValues, reset as resetForm } from 'redux-form'
......@@ -57,8 +58,9 @@ export default compose(
decision: get(getFormValues('recommendation')(state), 'decision'),
}),
{
createRecommendation,
resetForm,
createRecommendation,
getCollections: actions.getCollections,
},
),
withState('step', 'changeStep', 0),
......@@ -75,11 +77,13 @@ export default compose(
resetForm,
fragmentId,
collectionId,
getCollections,
createRecommendation,
}) => values => {
const recommendation = utils.parseRecommendationValues(values)
createRecommendation(collectionId, fragmentId, recommendation).then(r => {
resetForm('recommendation')
getCollections()
showModal({
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