From 5911897fee916add89b71884cdebb9c61e0de7e3 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Fri, 11 Dec 2020 14:41:19 +0530 Subject: [PATCH] Return TermSetId for suggestions --- src/services/SPTermStorePickerService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/SPTermStorePickerService.ts b/src/services/SPTermStorePickerService.ts index a434e1c2b..fb885452e 100644 --- a/src/services/SPTermStorePickerService.ts +++ b/src/services/SPTermStorePickerService.ts @@ -460,7 +460,7 @@ export default class SPTermStorePickerService { if (terms.length > 0) { // Retrieve all terms - let returnTerms: IPickerTerm[] = terms.map((term: ISuggestTerm) => this.convertSuggestTermToPickerTerm(term)); + let returnTerms: IPickerTerm[] = terms.map((term: ISuggestTerm) => this.convertSuggestTermToPickerTerm(term, TermSetId)); resolve(returnTerms); return; } @@ -597,7 +597,7 @@ export default class SPTermStorePickerService { }; } - private convertSuggestTermToPickerTerm(term: ISuggestTerm): IPickerTerm { + private convertSuggestTermToPickerTerm(term: ISuggestTerm, termSetId: string): IPickerTerm { let path: string = ""; let termSetName: string = ""; if (term.Paths && term.Paths.length > 0) { @@ -610,7 +610,7 @@ export default class SPTermStorePickerService { key: this.cleanGuid(term.Id), name: term.DefaultLabel, path: path, - termSet: EmptyGuid, // TermSet Guid is not given with suggestion + termSet: termSetId ? termSetId : EmptyGuid, // termSetId not returned by API, but we can get it from the payload termSetName: termSetName }; }