diff --git a/packages/component-helper-service/src/services/Fragment.js b/packages/component-helper-service/src/services/Fragment.js index 6d846b693d4993dbf2b15df7421d93bb043258b5..15267b2d0349ac73ed0ecc4d28126fedcc7ac32b 100644 --- a/packages/component-helper-service/src/services/Fragment.js +++ b/packages/component-helper-service/src/services/Fragment.js @@ -71,7 +71,7 @@ class Fragment { ) const userHelper = new User({ UserModel }) - const activeAuthors = userHelper.getActiveAuthors(authors) + const activeAuthors = await userHelper.getActiveAuthors(authors) const authorsList = activeAuthors.map( author => `${author.firstName} ${author.lastName}`, diff --git a/packages/component-manuscript-manager/src/tests/fragments/post.test.js b/packages/component-manuscript-manager/src/tests/fragments/post.test.js index 8e2a7f08443408f64d4c079b323ffdc9082aba54..07b6ff7a80ec6024f7e9126551c001eeeb32fad9 100644 --- a/packages/component-manuscript-manager/src/tests/fragments/post.test.js +++ b/packages/component-manuscript-manager/src/tests/fragments/post.test.js @@ -8,6 +8,7 @@ const requests = require('../requests') const { Model, fixtures } = fixturesService jest.mock('pubsweet-component-mail-service', () => ({ sendNotificationEmail: jest.fn(), + sendSimpleEmail: jest.fn(), })) const reqBody = {} diff --git a/packages/component-user-manager/src/routes/fragmentsUsers/get.js b/packages/component-user-manager/src/routes/fragmentsUsers/get.js index ebb0cd045ac5b5a9a4348b6c288e642aff29473d..646163deaa6d0bc62f7129055e4cda04bf64cada 100644 --- a/packages/component-user-manager/src/routes/fragmentsUsers/get.js +++ b/packages/component-user-manager/src/routes/fragmentsUsers/get.js @@ -12,7 +12,7 @@ module.exports = models => async (req, res) => { const { authors = [] } = await models.Fragment.find(fragmentId) const userHelper = new User({ UserModel: models.User }) - const activeAuthors = userHelper.getActiveAuthors(authors) + const activeAuthors = await userHelper.getActiveAuthors(authors) return res.status(200).json(activeAuthors) } catch (e) {