Skip to content

Migrate API client to the new /v1 route prefix #24

Description

@amrtgaber

api-template now serves every application route under a /v1 prefix (ag-tech-group/api-template#21). web-template needs to catch up before it's pointed at an API generated from the updated template.

What changed upstream

Before After
/auth/register, /auth/jwt/login, /auth/jwt/logout, /auth/refresh, /auth/me /v1/auth/...
/admin/users/{id}/role /v1/admin/users/{id}/role
/notes, /notes/{id} /v1/notes, /v1/notes/{id}
/flags /v1/flags
/, /health, /docs, /openapi.json unchanged (infrastructure, stays unversioned)

The refresh cookie is now scoped to path=/v1/auth/refresh.

To do

  • Regenerate the orval client against the updated OpenAPI spec (pnpm generate-api) — paths in the generated hooks should pick up /v1 automatically.
  • Grep for any hardcoded API paths not covered by codegen — especially anything hitting /flags (the FeatureFlagProvider), /auth/refresh, /auth/jwt/login, /auth/jwt/logout. The silent-refresh / logout flows are the most likely to be hand-written.
  • Check the dev proxy config (Vite server.proxy or equivalent) — if it proxies /auth, /notes, etc. to the API, update those prefixes to /v1 (or just proxy /v1).
  • If there's an API base-URL constant, decide whether /v1 belongs in the base URL or in the generated paths (orval will put it in the paths).
  • Smoke-test login → authenticated request → refresh → logout against an api-template instance built from main.

Not urgent — nothing breaks until web-template is pointed at an updated API — but worth doing before the next time someone scaffolds from these templates together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions