Newer
Older

Mihail Hagiu
committed
import { get, chain, find } from 'lodash'
export const handleError = fn => e => {
const errorForAuthorWhenHEWasRevoked =
'Your Handling Editor was changed. A new handling editor will be assigned to your manuscript soon. Sorry for the inconvenience.'
let error = get(
JSON.parse(e.response),
'error',
'Oops! Something went wrong!',
)
if (error === 'No revision has been found.') {
error = errorForAuthorWhenHEWasRevoked
}
fn(error)
export const getReportComments = ({ report, isPublic = false }) =>
chain(report)
.get('comments', [])
.find(c => c.public === isPublic)
.get('content')
.value()
export const indexReviewers = (reports = [], invitations = []) => {