File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
src/routes/copilotRequest Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 11import _ from 'lodash' ;
22
33import models from '../../models' ;
4- import { ADMIN_ROLES } from '../../constants' ;
54import util from '../../util' ;
65import { PERMISSION } from '../../permissions/constants' ;
76
@@ -16,16 +15,10 @@ module.exports = [
1615 return next ( err ) ;
1716 }
1817
19- const isAdmin = util . hasRoles ( req , ADMIN_ROLES ) ;
20-
21- const userId = req . authUser . userId ;
2218 const copilotRequestId = _ . parseInt ( req . params . copilotRequestId ) ;
2319
2420 // Admin can see all requests and the PM can only see requests created by them
25- const whereCondition = _ . assign ( { } ,
26- isAdmin ? { } : { createdBy : userId } ,
27- { id : copilotRequestId } ,
28- ) ;
21+ const whereCondition = { id : copilotRequestId } ;
2922
3023 return models . CopilotRequest . findOne ( {
3124 where : whereCondition ,
You can’t perform that action at this time.
0 commit comments