File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
src/service/functions/autocomplete Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ apiVersion: v1
2
2
description : A Helm chart for kube-ts-server
3
3
name : kube-ts-server
4
4
version : 1.0.0
5
- appVersion : 1.5.4
5
+ appVersion : 1.5.6
6
6
home : https://cloud.docker.com/u/kubejs/repository/docker/kubejs/kube-ts-server
7
7
icon : https://avatars2.githubusercontent.com/u/47761918?s=200&v=4
8
8
sources :
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ replicaCount: 2
6
6
7
7
image :
8
8
repository : kubejs/kube-ts-server
9
- tag : 1.5.4
9
+ tag : 1.5.6
10
10
pullPolicy : Always
11
11
containerPort : 3000
12
12
Original file line number Diff line number Diff line change
1
+ import { INSTRUCTOR } from '../../../constants/roles' ;
1
2
import getVisibleUserProperties from '../../../utils/helpers/model/getVisibleUserProperties' ;
2
3
import Config from '../../FactoryConfig' ;
3
4
@@ -41,8 +42,26 @@ export default ({ repo }: Config) => async ({ query }: Options) => {
41
42
} ,
42
43
} ) ;
43
44
45
+ const { items : roles } = await repo . roles . getItems ( {
46
+ filter : {
47
+ name : INSTRUCTOR ,
48
+ } ,
49
+ } ) ;
50
+
51
+ const instructorRoleId = roles [ 0 ] . id ;
52
+
53
+ const { items : usersRoles } = await repo . userRole . getItems ( {
54
+ filter : {
55
+ roleId : instructorRoleId ,
56
+ } ,
57
+ } ) ;
58
+
59
+ const instructorsIds = usersRoles . map ( userRole => userRole . userId ) ;
60
+
61
+ const filteredUsers = users . filter ( user => instructorsIds . includes ( user . id ) ) ;
62
+
44
63
return {
45
64
courses,
46
- users : users . map ( getVisibleUserProperties ) ,
65
+ users : filteredUsers . map ( getVisibleUserProperties ) ,
47
66
} ;
48
67
} ;
You can’t perform that action at this time.
0 commit comments