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 = [
234
234
( req , res , next ) => {
235
235
let failed = [ ] ;
236
236
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 ;
237
239
238
240
if ( ! invite . userIds && ! invite . emails ) {
239
241
const err = new Error ( 'Either userIds or emails are required' ) ;
@@ -343,6 +345,14 @@ module.exports = [
343
345
} ) ; // models.sequelize.Promise.all
344
346
} ) ; // models.ProjectMemberInvite.getPendingInvitesForProject
345
347
} )
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
+ ) )
346
356
. then ( ( values ) => {
347
357
const success = _ . assign ( { } , { success : values } ) ;
348
358
if ( failed . length ) {
You can’t perform that action at this time.
0 commit comments