@@ -38,10 +38,24 @@ const rolesRoutes = API.v1
3838 {
3939 authRequired : true ,
4040 response : {
41- 200 : ajv . compile < { roles : IRole [ ] } > ( {
41+ 200 : ajv . compile < { roles : Omit < IRole , '_updatedAt' > [ ] } > ( {
4242 type : 'object' ,
4343 properties : {
44- roles : { type : 'array' , items : { $ref : '#/components/schemas/IRole' } } ,
44+ roles : {
45+ type : 'array' ,
46+ items : {
47+ type : 'object' ,
48+ properties : {
49+ _id : { type : 'string' } ,
50+ description : { type : 'string' } ,
51+ mandatory2fa : { type : 'boolean' } ,
52+ name : { type : 'string' } ,
53+ protected : { type : 'boolean' } ,
54+ scope : { type : 'string' , enum : [ 'Users' , 'Subscriptions' ] } ,
55+ } ,
56+ required : [ '_id' , 'description' , 'name' , 'protected' , 'scope' ] ,
57+ } ,
58+ } ,
4559 success : { type : 'boolean' , enum : [ true ] } ,
4660 } ,
4761 required : [ 'roles' , 'success' ] ,
@@ -187,9 +201,9 @@ const rolesRoutes = API.v1
187201 }
188202
189203 const { cursor, totalCount } = await getUsersInRolePaginated ( roleData . _id , roomId , {
190- limit : count as number ,
204+ limit : count ,
191205 sort : { username : 1 } ,
192- skip : offset as number ,
206+ skip : offset ,
193207 projection,
194208 } ) ;
195209
0 commit comments