We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25b4d80 commit 6080e8eCopy full SHA for 6080e8e
src/routes/copilotOpportunity/get.js
@@ -34,10 +34,12 @@ module.exports = [
34
const plainOpportunity = copilotOpportunity.get({ plain: true });
35
req.log.info("authUser", req.authUser);
36
const memberIds = plainOpportunity.project.members.map((member) => member.userId);
37
+ const canApplyAsCopilot = !memberIds.includes(req.authUser.userId)
38
// This shouldn't be exposed to the clientside
39
delete plainOpportunity.project.members;
40
const formattedOpportunity = Object.assign({
41
members: memberIds,
42
+ canApplyAsCopilot,
43
}, plainOpportunity,
44
plainOpportunity.copilotRequest ? plainOpportunity.copilotRequest.data : {},
45
{ copilotRequest: undefined },
0 commit comments