File tree Expand file tree Collapse file tree
apps/meteor/app/api/server/v1
packages/rest-typings/src/v1/groups Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ API.v1.addRoute(
380380 throw new Meteor . Error ( 'error-not-allowed' , 'Not allowed' ) ;
381381 }
382382
383- const result = await deleteUserOwnAccount ( this . userId , password , confirmRelinquish ) ;
383+ await deleteUserOwnAccount ( this . userId , password , confirmRelinquish ) ;
384384
385385 return API . v1 . success ( ) ;
386386 } ,
@@ -548,7 +548,12 @@ API.v1.addRoute(
548548 ]
549549 : [ ] ;
550550
551- const result = await Users . col
551+ const [
552+ {
553+ sortedResults : users ,
554+ totalCount : [ { total } = { total : 0 } ] ,
555+ } = { sortedResults : [ ] , totalCount : [ ] } ,
556+ ] = await Users . col
552557 . aggregate < { sortedResults : IUser [ ] ; totalCount : { total : number } [ ] } > ( [
553558 {
554559 $match : nonEmptyQuery ,
@@ -580,11 +585,6 @@ API.v1.addRoute(
580585 ] )
581586 . toArray ( ) ;
582587
583- const {
584- sortedResults : users ,
585- totalCount : [ { total } = { total : 0 } ] ,
586- } = result [ 0 ] ;
587-
588588 return API . v1 . success ( {
589589 users,
590590 count : users . length ,
Original file line number Diff line number Diff line change @@ -4,35 +4,35 @@ import { ajv } from '../Ajv';
44export type GroupsListProps = PaginatedRequest < { name ?: string } > ;
55
66const groupsListPropsSchema = {
7- type : 'object' ,
8- properties : {
9- count : {
10- type : 'number' ,
11- nullable : true ,
12- } ,
13- offset : {
14- type : 'number' ,
15- nullable : true ,
16- } ,
17- sort : {
18- type : 'string' ,
19- nullable : true ,
20- } ,
21- fields : {
22- type : 'string' ,
23- nullable : true ,
24- } ,
25- query : {
26- type : 'string' ,
27- nullable : true ,
28- } ,
29- name : {
30- type : 'string' ,
31- nullable : true ,
32- } ,
33- } ,
34- required : [ ] ,
35- additionalProperties : false ,
7+ type : 'object' ,
8+ properties : {
9+ count : {
10+ type : 'number' ,
11+ nullable : true ,
12+ } ,
13+ offset : {
14+ type : 'number' ,
15+ nullable : true ,
16+ } ,
17+ sort : {
18+ type : 'string' ,
19+ nullable : true ,
20+ } ,
21+ fields : {
22+ type : 'string' ,
23+ nullable : true ,
24+ } ,
25+ query : {
26+ type : 'string' ,
27+ nullable : true ,
28+ } ,
29+ name : {
30+ type : 'string' ,
31+ nullable : true ,
32+ } ,
33+ } ,
34+ required : [ ] ,
35+ additionalProperties : false ,
3636} ;
3737
3838export const isGroupsListProps = ajv . compile < GroupsListProps > ( groupsListPropsSchema ) ;
You can’t perform that action at this time.
0 commit comments