File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/routes/projectMemberInvites Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,8 @@ module.exports = [
234234 ( req , res , next ) => {
235235 let failed = [ ] ;
236236 const invite = req . body . param ;
237+ // let us request user fields during creating, probably this should be move to GET by ID endpoint instead
238+ const fields = req . query . fields ? req . query . fields . split ( ',' ) : null ;
237239
238240 if ( ! invite . userIds && ! invite . emails ) {
239241 const err = new Error ( 'Either userIds or emails are required' ) ;
@@ -343,6 +345,14 @@ module.exports = [
343345 } ) ; // models.sequelize.Promise.all
344346 } ) ; // models.ProjectMemberInvite.getPendingInvitesForProject
345347 } )
348+ . then ( values => (
349+ // populate successful invites with user details if required
350+ util . getObjectsWithMemberDetails ( values , fields , req )
351+ . catch ( ( err ) => {
352+ req . log . error ( 'Cannot get user details for invites.' ) ;
353+ req . log . debug ( 'Error during getting user details for invites' , err ) ;
354+ } )
355+ ) )
346356 . then ( ( values ) => {
347357 const success = _ . assign ( { } , { success : values } ) ;
348358 if ( failed . length ) {
You can’t perform that action at this time.
0 commit comments