Skip to content

Commit

Permalink
Return TermSetId for suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamdsheth committed Dec 11, 2020
1 parent e7820de commit 5911897
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/SPTermStorePickerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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
};
}
Expand Down

0 comments on commit 5911897

Please sign in to comment.