@@ -76,7 +76,7 @@ export default class SPPeopleSearchService {
76
76
return ( mockUsers && mockUsers . length > 0 ) ? mockUsers [ 0 ] : null ;
77
77
} else {
78
78
// If groupId is array, load data from all groups
79
- if ( groupId !== null && typeof ( groupId ) === 'object' ) {
79
+ if ( Array . isArray ( groupId ) ) {
80
80
let userResults : IPeoplePickerUserItem [ ] = [ ] ;
81
81
for ( const id of groupId ) {
82
82
let tmpResults = await this . searchTenant ( siteUrl , email , 1 , principalTypes , ensureUser , id ) ;
@@ -88,7 +88,7 @@ export default class SPPeopleSearchService {
88
88
let filteredUserResults = userResults . filter ( ( { loginName} , index ) => ! logins . includes ( loginName , index + 1 ) ) ;
89
89
return ( filteredUserResults && filteredUserResults . length > 0 ) ? filteredUserResults [ 0 ] : null ;
90
90
} else {
91
- const userResults = await this . searchTenant ( siteUrl , email , 1 , principalTypes , ensureUser , groupId as string | number ) ;
91
+ const userResults = await this . searchTenant ( siteUrl , email , 1 , principalTypes , ensureUser , groupId ) ;
92
92
return ( userResults && userResults . length > 0 ) ? userResults [ 0 ] : null ;
93
93
}
94
94
}
@@ -103,7 +103,7 @@ export default class SPPeopleSearchService {
103
103
return this . searchPeopleFromMock ( query ) ;
104
104
} else {
105
105
// If groupId is array, load data from all groups
106
- if ( groupId !== null && typeof ( groupId ) === 'object' ) {
106
+ if ( Array . isArray ( groupId ) ) {
107
107
let userResults : IPeoplePickerUserItem [ ] = [ ] ;
108
108
for ( const id of groupId ) {
109
109
let tmpResults = await this . searchTenant ( siteUrl , query , maximumSuggestions , principalTypes , ensureUser , id ) ;
@@ -115,7 +115,7 @@ export default class SPPeopleSearchService {
115
115
let filteredUserResults = userResults . filter ( ( { loginName} , index ) => ! logins . includes ( loginName , index + 1 ) ) ;
116
116
return filteredUserResults ;
117
117
} else {
118
- return await this . searchTenant ( siteUrl , query , maximumSuggestions , principalTypes , ensureUser , groupId as string | number ) ;
118
+ return await this . searchTenant ( siteUrl , query , maximumSuggestions , principalTypes , ensureUser , groupId ) ;
119
119
}
120
120
}
121
121
}
0 commit comments