@@ -16,7 +16,7 @@ const constants = require('../../app-constants')
16
16
* @param {Boolean } isAdmin flag indicating whether the current user is an admin or not
17
17
* @returns {Object } the search result
18
18
*/
19
- async function searchGroups ( criteria , isAdmin = false ) {
19
+ async function searchGroups ( criteria , isAdmin ) {
20
20
logger . debug ( `Search Group - Criteria - ${ JSON . stringify ( criteria ) } ` )
21
21
22
22
if ( ( criteria . memberId || criteria . universalUID ) && ! criteria . membershipType ) {
@@ -94,7 +94,7 @@ async function searchGroups(criteria, isAdmin = false) {
94
94
whereClause = ` WHERE g.status = '${ constants . GroupStatus . Active } '`
95
95
} else {
96
96
whereClause = whereClause . concat ( ` AND g.status = '${ constants . GroupStatus . Active } '` )
97
- }
97
+ }
98
98
}
99
99
100
100
// query total record count
@@ -167,7 +167,10 @@ searchGroups.schema = {
167
167
privateGroup : Joi . boolean ( ) ,
168
168
includeSubGroups : Joi . boolean ( ) . default ( false ) ,
169
169
includeParentGroup : Joi . boolean ( ) . default ( false ) ,
170
- oneLevel : Joi . boolean ( )
170
+ oneLevel : Joi . boolean ( ) ,
171
+ status : Joi . string ( )
172
+ . valid ( [ constants . GroupStatus . Active , constants . GroupStatus . InActive ] )
173
+ . default ( constants . GroupStatus . Active )
171
174
} )
172
175
}
173
176
0 commit comments