From 6b412d88fbbe11c3a33e81b9d9673d3a90e2c29b Mon Sep 17 00:00:00 2001
From: Alexandru Munteanu <alexandru.munt@gmail.com>
Date: Fri, 18 May 2018 15:35:18 +0300
Subject: [PATCH] (make-recommendation): get collections after recommendation

---
 .../src/components/MakeRecommendation/RecommendWizard.js    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js b/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js
index e6c32a080..28021cc18 100644
--- a/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js
+++ b/packages/components-faraday/src/components/MakeRecommendation/RecommendWizard.js
@@ -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',
         })
-- 
GitLab