Skip to content

Commit

Permalink
Merge pull request #762 from gautamdsheth/bugfix/returnTermSetId
Browse files Browse the repository at this point in the history
Fix - Return TermSetId for suggestions
  • Loading branch information
AJIXuMuK authored Dec 12, 2020
2 parents e7820de + 5911897 commit a2281ac
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 a2281ac

Please sign in to comment.