File tree 1 file changed +1
-9
lines changed
src/routes/copilotRequest
1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
2
3
3
import models from '../../models' ;
4
- import { ADMIN_ROLES } from '../../constants' ;
5
4
import util from '../../util' ;
6
5
import { PERMISSION } from '../../permissions/constants' ;
7
6
@@ -16,9 +15,6 @@ module.exports = [
16
15
return next ( err ) ;
17
16
}
18
17
19
- const isAdmin = util . hasRoles ( req , ADMIN_ROLES ) ;
20
-
21
- const userId = req . authUser . userId ;
22
18
const projectId = _ . parseInt ( req . params . projectId ) ;
23
19
24
20
let sort = req . query . sort ? decodeURIComponent ( req . query . sort ) : 'createdAt desc' ;
@@ -31,11 +27,7 @@ module.exports = [
31
27
}
32
28
const sortParams = sort . split ( ' ' ) ;
33
29
34
- // Admin can see all requests and the PM can only see requests created by them
35
- const whereCondition = _ . assign ( { } ,
36
- isAdmin ? { } : { createdBy : userId } ,
37
- projectId ? { projectId } : { } ,
38
- ) ;
30
+ const whereCondition = projectId ? { projectId } : { } ;
39
31
40
32
return models . CopilotRequest . findAll ( {
41
33
where : whereCondition ,
You can’t perform that action at this time.
0 commit comments