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:
@@ -47,7 +47,10 @@ export async function saveCadPartMaterials(
|
||||
itemId: string,
|
||||
parts: Array<{ part_name: string; material: string }>,
|
||||
) {
|
||||
const res = await api.put(`/orders/${orderId}/items/${itemId}/cad-materials`, { parts })
|
||||
const res = await api.put<{ parts: Array<{ part_name: string; material: string }> }>(
|
||||
`/orders/${orderId}/items/${itemId}/cad-materials`,
|
||||
{ parts },
|
||||
)
|
||||
return res.data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user