Skip to content

Update Serving API - from backend PR #6633 - #386

Merged
abbaseya merged 1 commit into
main-convertfrom
api-serving-update-6633
May 22, 2026
Merged

Update Serving API - from backend PR #6633#386
abbaseya merged 1 commit into
main-convertfrom
api-serving-update-6633

Conversation

@clllaur

@clllaur clllaur commented May 22, 2026

Copy link
Copy Markdown
Contributor

Updating TS Serving API after the latest changes from backend repo,
PR #6633

@clllaur
clllaur requested a review from a team May 22, 2026 17:58
@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the PlanStatus and Products types and refactors several goal and trigger definitions to use enum members instead of string literals. Feedback indicates that changing ConfigGoalBase.type from an array to a single GoalTypes value is overly restrictive and will cause TypeScript errors for specific goal types. Additionally, it is recommended to add 'visits_page' to the GoalTypes enum to ensure consistency across the NoSettingsGoal definition.

Comment on lines 1878 to +1881
/**
* List of goal types to be returned
*/
type?: Array<GoalTypes>;
type?: GoalTypes;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The change from Array<GoalTypes> to GoalTypes is too restrictive. Several goal types that extend ConfigGoalBase (such as GaGoal, SubmitsFormGoal, ClicksLinkGoal, and ClicksElementGoal) use type strings that are not present in the GoalTypes enum, which will lead to TypeScript errors. Additionally, the JSDoc comment 'List of goal types to be returned' should be updated to reflect that it is now a single value.


export type NoSettingsGoal = ConfigGoalBase & {
type?: 'advanced' | 'visits_page' | 'code_trigger';
type?: GoalTypes.ADVANCED | 'visits_page' | GoalTypes.CODE_TRIGGER;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line mixes enum members (GoalTypes.ADVANCED, GoalTypes.CODE_TRIGGER) with a string literal ('visits_page'). For consistency and better type safety, visits_page should be added to the GoalTypes enum and used here.

@abbaseya
abbaseya merged commit fb85fe9 into main-convert May 22, 2026
6 checks passed
@abbaseya
abbaseya deleted the api-serving-update-6633 branch May 22, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants