Skip to content

Commit

Permalink
feat(tracking-plan): refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrpo committed Jul 17, 2024
1 parent 299e73e commit b71d841
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/cli/api/trackingplans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,8 @@ export function toTrackingPlanId(trackingPlan: RudderAPI.TrackingPlan): string {
return trackingPlan.id;
}

export function getTrackingPlanName(trackingPlan: RudderAPI.TrackingPlan): string {
// throw new Error(`Unable to parse Tracking Plan name: ${JSON.stringify(trackingPlan)}`);
if (!trackingPlan.creationType) {
return trackingPlan.display_name;
}

return trackingPlan.name;
export function getTrackingPlanName(
trackingPlan: Pick<RudderAPI.TrackingPlan, 'creationType' | 'display_name' | 'name'>,
): string {
return !trackingPlan.creationType ? trackingPlan.display_name : trackingPlan.name;
}

0 comments on commit b71d841

Please sign in to comment.