Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bcameron1231 committed Aug 8, 2024
1 parent 85242d0 commit ebcc5db
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/graph/taxonomy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,32 @@ export class _TermSet extends _GraphInstance<ITermStoreType.Set> {
*
* @returns Array of children for this item
*/
public async getAllChildrenAsTree(props?:{retrieveProperties?:boolean}): Promise<IOrderedTermInfo[]> {

let selects = ["*"];
if(props?.retrieveProperties){
// graph does not let us wildcard + select properties
selects=["id", "labels", "createdDateTime", "lastModifiedDateTime", "labels", "descriptions", "properties"];
}
public async getAllChildrenAsTree(props?: {retrieveProperties?: boolean}): Promise<IOrderedTermInfo[]> {

const visitor = async (source: ITerm | ITermSet, parent: IOrderedTermInfo[]) => {
const children = await source.children.select(...selects)();

for (let i = 0; i < children.length; i++) {

const child = children[i];
const orderedTerm: Partial<IOrderedTermInfo> = {
children: <IOrderedTermInfo[]>[],
defaultLabel: child.labels.find(l => l.isDefault).name,
...child,
};

parent.push(<any>orderedTerm);

await visitor(this.getTermById(child.id), <any>orderedTerm.children);
}
};

let selects = ["*"];
if(props?.retrieveProperties){
// graph does not let us wildcard + select properties
selects=["id", "labels", "createdDateTime", "lastModifiedDateTime", "labels", "descriptions", "properties"];
}

const tree: IOrderedTermInfo[] = [];

await visitor(<any>this, tree);
Expand Down

0 comments on commit ebcc5db

Please sign in to comment.