Commit 7dcde0cc authored by nickstiffler's avatar nickstiffler Committed by Yannis Barlas

feat(api): add email property to users

parent 9089af10
const clone = require('lodash/clone')
const {
Identity,
ManuscriptVersion,
Review,
Team,
......@@ -93,7 +94,16 @@ const submitReview = async (_, { reviewId, input }, ctx) => {
const reviewer = async (review, __, ctx) => {
try {
return User.findById(review.reviewerId)
const user = await User.findById(review.reviewerId)
const identity = await Identity.query().findOne({
isDefault: true,
userId: user.id,
})
user.email = identity.email
return user
} catch (e) {
throw new Error(e)
}
......
......@@ -45,6 +45,7 @@ const currentUser = async (_, { input }, ctx) => {
})
user.orcid = identity.orcid
user.email = identity.email
return user
}
......
Markdown is supported
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