chore(console): remove legacy api.ts endpoints no longer served by the backend#285
Open
jeroenrinzema wants to merge 1 commit into
Open
chore(console): remove legacy api.ts endpoints no longer served by the backend#285jeroenrinzema wants to merge 1 commit into
jeroenrinzema wants to merge 1 commit into
Conversation
…e backend
The management backend serves only what's in the OpenAPI spec (the oapi
router plus a request-validator middleware reject off-spec paths). Several
endpoints still called through the legacy axios `api.ts` client have no
matching spec path, so they 404 against the current backend. This removes
them and the now-orphaned UI that called them, as a first step toward
retiring `api.ts` entirely.
Removed from api.ts (no callers; not in spec):
- data.userPaths / data.rebuild (data/paths/users, data/paths/sync)
- resources.* (resources)
- tags.* (tags, tags/used, tags/assign)
- lists.recount (lists/{id}/recount)
- users.lists (subjects/users/{id}/lists)
- organizations.members.* (subjects/organizations/{id}/members)
- journeys.steps.searchUsers (journeys/{id}/steps/{id}/users)
- journeys.entrances.* (journeys/{id}/entrances, journeys/entrances/{id})
- journeys.users.skipDelay / removeFromJourney (steps/{id}/resume, step/{id})
UI removed (reached only via the above, all backed by dead endpoints):
- EntranceDetails + JourneyUserEntrances pages and their orphan routes
- JourneyStepUsers panel and the step-sidebar "view users" click-through
(the step stats card itself is kept, now non-interactive)
Kept: journeys.users.getState (in spec, used by the editor), path
suggestions, and locales.getByKey (still in use; to be migrated separately).
tsc + eslint clean, journey unit tests pass, production build succeeds.
Contributor
There was a problem hiding this comment.
Pull request overview
Removes legacy console/src/api.ts client endpoints that no longer exist in the backend OpenAPI router, and deletes the now-orphaned UI/routes that depended on those endpoints (notably journey entrance/user-step views). This helps shrink the unsupported surface area of the legacy client as a first step toward retiring api.ts.
Changes:
- Removed dead legacy
api.tsmethods (journey entrances/step users, org members, tags/resources, list recount, etc.) that are no longer served by the backend. - Removed unreachable journey UI pages/panels and their routing/plumbing (entrance details, journey user entrances, “view users” step panel).
- Simplified journey editor/canvas/sidebar types and props by removing the
onViewUsers/setViewUsersStepwiring.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| console/src/views/router.tsx | Removes the now-dead journey entrances routes and corresponding component imports. |
| console/src/views/journey/JourneyUserEntrances.tsx | Deletes orphaned page that queried removed journeys.entrances.search. |
| console/src/views/journey/JourneyStepUsers.tsx | Deletes orphaned “users in step” dialog that depended on removed legacy endpoints. |
| console/src/views/journey/hooks/useJourneyPersistence.ts | Removes setViewUsersStep action type from journey persistence actions. |
| console/src/views/journey/EntranceDetails.tsx | Deletes orphaned entrance details page and its exported typeVariants. |
| console/src/views/journey/editor/JourneyEditor.utils.ts | Removes setViewUsersStep from the stepsToNodes actions contract. |
| console/src/views/journey/editor/JourneyEditor.types.ts | Removes setViewUsersStep from JourneyNodeData. |
| console/src/views/journey/editor/JourneyEditor.tsx | Removes state/handlers/rendering for the deleted JourneyStepUsers dialog and sidebar plumbing. |
| console/src/views/journey/components/JourneyStepSidebar.tsx | Removes the “view users” click-through behavior; keeps the stats card as non-interactive UI. |
| console/src/views/journey/components/JourneyCanvas.tsx | Removes onViewUsers from the sidebar prop surface and call site. |
| console/src/api.ts | Removes legacy endpoints/types that are no longer routed by the backend; simplifies organizations to the base entity path only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The management API is served only through the OpenAPI-generated router (
mgmtoapi.HandlerWithOptions) with a request-validator middleware — anything not inresources.ymlisn't routed. Auditing the legacy axiosapi.tsclient against the spec surfaced a set of endpoints it still calls that have no matching spec path, so they 404 against the current backend. Per the decision that we won't support these going forward, this removes them and the now-orphaned UI that depended on them.This is step 1 toward retiring
api.tsentirely — it clears the dead/unsupported surface so the remaining migration of live endpoints onto the generated client is unblocked and cleaner.Removed from
api.ts(verified zero callers, not in spec)data.userPaths,data.rebuilddata/paths/users,data/paths/syncresources.*resourcestags.*tags,tags/used,tags/assignlists.recountlists/{id}/recountusers.listssubjects/users/{id}/listsorganizations.members.*subjects/organizations/{id}/membersjourneys.steps.searchUsersjourneys/{id}/steps/{id}/usersjourneys.entrances.*journeys/{id}/entrances,journeys/entrances/{id}journeys.users.skipDelay/removeFromJourney…/steps/{id}/resume,…/step/{id}UI removed (only reachable via the dead endpoints above)
setViewUsersStep/onViewUsersplumbing threaded through the editor, canvas, sidebar, and node-action types.Explicitly kept
journeys.users.getState— in the spec, used by the editor for step-completion indicators.projects.pathSuggestions) — still a needed feature; will move to the schema-based approach separately.locales.getByKey— still in use by the template editor; handled in a later step.Verification
tsc --noEmitcleaneslintclean (0 errors; remaining warnings are pre-existing prettier nits in untouched files)