Skip to content
Snippets Groups Projects
Commit c9a8c380 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

fix(reviewers): second decline appropriate message

parent 3c6d5ae5
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
...@@ -3,10 +3,12 @@ import { th } from '@pubsweet/ui' ...@@ -3,10 +3,12 @@ import { th } from '@pubsweet/ui'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import styled from 'styled-components' import styled from 'styled-components'
import { withJournal } from 'xpub-journal' import { withJournal } from 'xpub-journal'
import { replace } from 'react-router-redux'
import { compose, lifecycle } from 'recompose' import { compose, lifecycle } from 'recompose'
import { RootContainer, Title } from './FormItems' import { RootContainer, Title } from './FormItems'
import { reviewerDecline } from '../../redux/reviewers' import { reviewerDecline } from '../../redux/reviewers'
import { redirectToError } from '../utils'
const ReviewerDecline = ({ journal: { metadata: { email } } }) => ( const ReviewerDecline = ({ journal: { metadata: { email } } }) => (
<RootContainer> <RootContainer>
...@@ -26,7 +28,7 @@ const ReviewerDecline = ({ journal: { metadata: { email } } }) => ( ...@@ -26,7 +28,7 @@ const ReviewerDecline = ({ journal: { metadata: { email } } }) => (
export default compose( export default compose(
withJournal, withJournal,
connect(null, { reviewerDecline }), connect(null, { reviewerDecline, replace }),
lifecycle({ lifecycle({
componentDidMount() { componentDidMount() {
const { const {
...@@ -34,8 +36,11 @@ export default compose( ...@@ -34,8 +36,11 @@ export default compose(
invitationId, invitationId,
invitationToken, invitationToken,
reviewerDecline, reviewerDecline,
replace,
} = this.props } = this.props
reviewerDecline(invitationId, collectionId, invitationToken) reviewerDecline(invitationId, collectionId, invitationToken).catch(
redirectToError(replace),
)
}, },
}), }),
)(ReviewerDecline) )(ReviewerDecline)
......
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