Skip to content

Typescript: API Modules > client.js → client.ts #8011

Description

@n-lark

client.js → client.ts

First file of the Phase 3 API-module TypeScript migration. Converts the shared axios client — the foundation every other api/* module imports — to .ts, typing the default export as AxiosInstance so .get<T>() / .post<T>() generics work downstream. Mechanical: rename, type the client and interceptor error param, drop .js from imports. No behavior change.

  • npx vue-tsc --noEmit from frontend/ — no new errors (2 remaining errors are pre-existing, in unrelated files)
  • client.ts default export types as AxiosInstance; the 6 importers still resolve
  • App loads; an authenticated GET (e.g. team list) succeeds
  • 401 on an expired session triggers logout
  • Network drop sets offline state

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions