Skip to content

Commit 8411731

Browse files
committed
added opp id to the where clause
1 parent d093fe5 commit 8411731

File tree

1 file changed

+4
-1
lines changed
  • src/routes/copilotOpportunityApply

1 file changed

+4
-1
lines changed

src/routes/copilotOpportunityApply/list.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = [
1414
console.log("start list operation");
1515
const isAdmin = util.hasRoles(req, ADMIN_ROLES);
1616
const userId = req.authUser.userId;
17+
const opportunityId = _.parseInt(req.params.id);
1718

1819
let sort = req.query.sort ? decodeURIComponent(req.query.sort) : 'createdAt desc';
1920
if (sort.indexOf(' ') === -1) {
@@ -26,7 +27,9 @@ module.exports = [
2627
const sortParams = sort.split(' ');
2728

2829
// Admin can see all requests and the PM can only see requests created by them
29-
const whereCondition = _.assign({},
30+
const whereCondition = _.assign({
31+
opportunityId,
32+
},
3033
isAdmin ? {} : { createdBy: userId },
3134
);
3235

0 commit comments

Comments
 (0)