table import works now
Some checks failed
Deploy to Server / deploy (push) Failing after 1m7s

This commit is contained in:
2026-04-24 18:19:54 -05:00
parent 4098453c97
commit 24d126eeb9
6 changed files with 524 additions and 118 deletions

View File

@@ -35,11 +35,23 @@ export const chemicalsApi = {
remove: (id: string): Promise<void> =>
apiFetch(`/api/chemicals/${id}`, { method: 'DELETE' }).then(() => undefined),
bulkRemove: (ids: string[]): Promise<void> =>
apiFetch('/api/chemicals/bulk-delete', {
method: 'POST',
body: JSON.stringify({ ids })
}).then(() => undefined),
import: (rows: Partial<ChemicalInventory>[]): Promise<{ imported: number; errors: string[] }> =>
apiFetch('/api/chemicals/import', {
method: 'POST',
body: JSON.stringify({ rows }),
}).then(r => r.json()),
columnMatch: (headers: string[], sampleRows: string[][]): Promise<{ mappings: { header: string; key: string; confidence: number; reason: string }[] }> =>
apiFetch('/api/chemicals/column-match', {
method: 'POST',
body: JSON.stringify({ headers, sampleRows }),
}).then(r => r.json()),
};
export const protocolsApi = {