Skip to content

Commit 81effa6

Browse files
committed
fix: send members as part of opportunity
1 parent 8612e02 commit 81effa6

File tree

1 file changed

+2
-9
lines changed
  • src/routes/copilotOpportunity

1 file changed

+2
-9
lines changed

src/routes/copilotOpportunity/get.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,11 @@ module.exports = [
3232
})
3333
.then((copilotOpportunity) => {
3434
const plainOpportunity = copilotOpportunity.get({ plain: true });
35-
let canApplyAsCopilot = false;
36-
req.log.info(plainOpportunity.project.members);
37-
req.log.info(req.authUser, 'authuser');
38-
if (plainOpportunity && plainOpportunity.project && plainOpportunity.project.members && req.authUser) {
39-
const existingMember = plainOpportunity.project.members.find(item => item.userId === req.authUser.userId);
40-
req.log.info(existingMember, 'existingMember');
41-
canApplyAsCopilot = !!!existingMember;
42-
}
35+
const memberIds = plainOpportunity.project.members.map((member) => member.userId);
4336
// This shouldn't be exposed to the clientside
4437
delete plainOpportunity.project.members;
4538
const formattedOpportunity = Object.assign({
46-
canApplyAsCopilot,
39+
members: memberIds,
4740
}, plainOpportunity,
4841
plainOpportunity.copilotRequest ? plainOpportunity.copilotRequest.data : {},
4942
{ copilotRequest: undefined },

0 commit comments

Comments
 (0)