596360e507
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>
24 lines
797 B
TypeScript
24 lines
797 B
TypeScript
import api from './client'
|
|
|
|
export interface ImportValidation {
|
|
id: string
|
|
status: 'pending' | 'running' | 'completed' | 'failed'
|
|
summary: {
|
|
total_rows: number
|
|
rows_with_cad: number
|
|
rows_without_cad: number
|
|
unresolvable_materials: Array<{ row_name: string; material: string }>
|
|
} | null
|
|
created_at: string
|
|
completed_at: string | null
|
|
}
|
|
|
|
export async function getImportValidation(id: string): Promise<ImportValidation> {
|
|
const res = await api.get<ImportValidation>(`/imports/validation/${id}`)
|
|
return res.data
|
|
}
|
|
|
|
export async function addMaterialAliasFromValidation(validationId: string, partName: string, materialName: string): Promise<void> {
|
|
await api.post(`/imports/validation/${validationId}/add-alias`, { part_name: partName, material_name: materialName })
|
|
}
|