We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d093fe5 commit 8411731Copy full SHA for 8411731
src/routes/copilotOpportunityApply/list.js
@@ -14,6 +14,7 @@ module.exports = [
14
console.log("start list operation");
15
const isAdmin = util.hasRoles(req, ADMIN_ROLES);
16
const userId = req.authUser.userId;
17
+ const opportunityId = _.parseInt(req.params.id);
18
19
let sort = req.query.sort ? decodeURIComponent(req.query.sort) : 'createdAt desc';
20
if (sort.indexOf(' ') === -1) {
@@ -26,7 +27,9 @@ module.exports = [
26
27
const sortParams = sort.split(' ');
28
29
// Admin can see all requests and the PM can only see requests created by them
- const whereCondition = _.assign({},
30
+ const whereCondition = _.assign({
31
+ opportunityId,
32
+ },
33
isAdmin ? {} : { createdBy: userId },
34
);
35
0 commit comments