Skip to content

Commit 6080e8e

Browse files
committed
debug auth user
1 parent 25b4d80 commit 6080e8e

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

src/routes/copilotOpportunity/get.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ module.exports = [
3434
const plainOpportunity = copilotOpportunity.get({ plain: true });
3535
req.log.info("authUser", req.authUser);
3636
const memberIds = plainOpportunity.project.members.map((member) => member.userId);
37+
const canApplyAsCopilot = !memberIds.includes(req.authUser.userId)
3738
// This shouldn't be exposed to the clientside
3839
delete plainOpportunity.project.members;
3940
const formattedOpportunity = Object.assign({
4041
members: memberIds,
42+
canApplyAsCopilot,
4143
}, plainOpportunity,
4244
plainOpportunity.copilotRequest ? plainOpportunity.copilotRequest.data : {},
4345
{ copilotRequest: undefined },

0 commit comments

Comments
 (0)