Skip to content

Commit

Permalink
fix: update points-to property because it's not always set (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Oct 25, 2024
1 parent b3b8d49 commit 73ff013
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/fdr-sdk/src/navigation/utils/toRootNode.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { DocsV2Read, FernNavigation } from "../..";
import { FernNavigationV1ToLatest } from "../migrators/v1ToV2";
import { mutableUpdatePointsTo } from "./updatePointsTo";

export function toRootNode(
docs: DocsV2Read.LoadDocsForUrlResponse,
disableEndpointPairs: boolean = false,
paginated?: boolean,
): FernNavigation.RootNode {
const v1 = FernNavigation.V1.toRootNode(docs, disableEndpointPairs, paginated);
return FernNavigationV1ToLatest.create().root(v1);
const latest = FernNavigationV1ToLatest.create().root(v1);
// update all `pointsTo`
mutableUpdatePointsTo(latest);
return latest;
}

0 comments on commit 73ff013

Please sign in to comment.