refactor(section-d): frontend API client type safety audit

All 19 api/*.ts files already used import api from './client' (X-Tenant-ID
guaranteed). Fixed missing type generics and any usage in 10 files:
- worker.ts: args: any[] → unknown[]
- imports.ts, notifications.ts: add response type generics
- renderTemplates.ts: add typed generics on 6 calls
- materials.ts, cad.ts: type previously untyped api calls
- products.ts: ProductCadUploadResponse interface, typed generics
- uploads.ts: StepUploadResponse interface
- billing.ts, orders.ts: <Blob> on download calls

Zero bare axios usage, zero as any in API layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 20:36:48 +01:00
parent 69e94e25e3
commit 596360e507
10 changed files with 59 additions and 24 deletions
+1 -1
View File
@@ -100,6 +100,6 @@ export async function generateGltfProduction(cadFileId: string): Promise<Generat
/** Force-reset a CAD file stuck in 'processing' to 'failed'. */
export async function resetStuckProcessing(cadFileId: string): Promise<{ status: string; message: string }> {
const res = await api.post(`/cad/${cadFileId}/reset-stuck`)
const res = await api.post<{ status: string; message: string }>(`/cad/${cadFileId}/reset-stuck`)
return res.data
}