Skip to content
Snippets Groups Projects
Commit 2113190c authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

feat(deactivate-user): fixes

parent 71ce91f4
No related branches found
No related tags found
1 merge request!14Sprint #15
......@@ -171,7 +171,7 @@ class Email {
} else {
const fragment = await FragmentModel.find(id)
const userHelper = new User({ UserModel })
const activeAuthors = userHelper.getActiveAuthors(fragment.authors)
const activeAuthors = await userHelper.getActiveAuthors(fragment.authors)
toAuthors = activeAuthors.map(author => ({
email: author.email,
......
......@@ -55,13 +55,11 @@ module.exports = models => async (req, res) => {
if (!members) return res.status(200).json([])
// TO DO: handle case for when the invitationID is provided
const invitationHelper = new Invitation({ role })
const membersData = members.map(async member => {
const user = await models.User.find(member)
if (!user.isActive) return null
invitationHelper.userId = user.id
const {
invitedOn,
......
......@@ -45,7 +45,7 @@ describe('Get fragment invitations route handler', () => {
expect(res.statusCode).toBe(200)
const data = JSON.parse(res._getData())
expect(data).toHaveLength(1)
expect(data).toHaveLength(2)
})
it('should return an error when parameters are missing', async () => {
const { handlingEditor } = testFixtures.users
......
......@@ -33,7 +33,9 @@ const ReviewersSelect = ({
label = 'Email*',
}) => {
const active = !!get(formMeta, 'email.active')
const filteredValues = values.filter(v => v.email.includes(reviewerEmail))
const filteredValues = values
.filter(v => v.isActive)
.filter(v => v.email.includes(reviewerEmail))
return (
<Root>
<FormLabel>{label}</FormLabel>
......
......@@ -46,7 +46,7 @@ module.exports = {
API_ENDPOINT: '/api',
baseUrl: process.env.CLIENT_BASE_URL || 'http://localhost:3000',
'login-redirect': '/',
'redux-log': false,
'redux-log': true,
theme: process.env.PUBSWEET_THEME,
},
orcid: {
......
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