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'
import { connect } from 'react-redux'
import styled from 'styled-components'
import { withJournal } from 'xpub-journal'
import { replace } from 'react-router-redux'
import { compose, lifecycle } from 'recompose'
import { RootContainer, Title } from './FormItems'
import { reviewerDecline } from '../../redux/reviewers'
import { redirectToError } from '../utils'
const ReviewerDecline = ({ journal: { metadata: { email } } }) => (
<RootContainer>
......@@ -26,7 +28,7 @@ const ReviewerDecline = ({ journal: { metadata: { email } } }) => (
export default compose(
withJournal,
connect(null, { reviewerDecline }),
connect(null, { reviewerDecline, replace }),
lifecycle({
componentDidMount() {
const {
......@@ -34,8 +36,11 @@ export default compose(
invitationId,
invitationToken,
reviewerDecline,
replace,
} = this.props
reviewerDecline(invitationId, collectionId, invitationToken)
reviewerDecline(invitationId, collectionId, invitationToken).catch(
redirectToError(replace),
)
},
}),
)(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