From 5bdf0ad08aea698d7f84691e5ad5e2064b2d09d0 Mon Sep 17 00:00:00 2001 From: a1exymoroz Date: Thu, 29 Jul 2021 17:51:42 +0300 Subject: [PATCH] feat/#958 Add selected items for groups --- src/services/PeopleSearchService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/PeopleSearchService.ts b/src/services/PeopleSearchService.ts index a08e94b65..78974a346 100644 --- a/src/services/PeopleSearchService.ts +++ b/src/services/PeopleSearchService.ts @@ -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, @@ -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 {