File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/routes/copilotOpportunity Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -68,15 +68,18 @@ module.exports = [
6868 const plainOpportunity = opportunity . get ( { plain : true } ) ;
6969
7070 req . log . debug ( isAdminOrManager , 'admin or manager' , plainOpportunity ) ;
71+
72+ const formatted = Object . assign ( { } , plainOpportunity ,
73+ plainOpportunity . copilotRequest ? plainOpportunity . copilotRequest . data : { } ,
74+ { copilotRequest : undefined } ,
75+ ) ;
76+
7177 // For users who are not admin or manager, we dont want to expose
7278 // the project id
7379 if ( ! isAdminOrManager ) {
7480 delete plainOpportunity . projectId ;
7581 }
76- return Object . assign ( { } , plainOpportunity ,
77- plainOpportunity . copilotRequest ? plainOpportunity . copilotRequest . data : { } ,
78- { copilotRequest : undefined } ,
79- ) ;
82+ return formatted ;
8083 } ) ;
8184 return util . setPaginationHeaders ( req , res , {
8285 count : copilotOpportunities . count ,
You can’t perform that action at this time.
0 commit comments