Skip to content

Commit

Permalink
feat/#958 Add selected items for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
a1exymoroz committed Jul 29, 2021
1 parent 2fc3d2e commit 5bdf0ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/PeopleSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default class SPPeopleSearchService {
switch (element.EntityType) {
case 'User':
const accountName: string = element.Description || "";
const email: string = element.EntityData.Email || element.Description;
const email: string = element.EntityData?.Email || element.Description;
return {
id: element.Key,
loginName: element.LoginName ? element.LoginName : element.Key,
Expand All @@ -240,12 +240,13 @@ export default class SPPeopleSearchService {
optionalText: "" // anything
} as IPeoplePickerUserItem;
case 'SecGroup':
const secondaryText = element.EntityData?.Email || element.ProviderName
return {
id: element.Key,
loginName: element.LoginName ? element.LoginName : element.Key,
imageInitials: this.getFullNameInitials(element.DisplayText),
text: element.DisplayText,
secondaryText: element.ProviderName
secondaryText,
} as IPeoplePickerUserItem;
case 'FormsRole':
return {
Expand Down

0 comments on commit 5bdf0ad

Please sign in to comment.