v1 of protocol checker
All checks were successful
Deploy to Server / deploy (push) Successful in 34s

This commit is contained in:
Aniketh Kalagara
2026-04-14 19:08:02 -05:00
parent 2f69f57cf7
commit 4098453c97
7 changed files with 328 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
import type { ChemicalInventory, SafetyIssue } from '../shared/types';
import type { ChemicalInventory, Protocol, SafetyIssue } from '../shared/types';
async function apiFetch(path: string, options: RequestInit = {}): Promise<Response> {
const res = await fetch(path, {
@@ -64,6 +64,11 @@ export const protocolsApi = {
body: JSON.stringify({ analysis_results: results }),
}).then(r => r.json()),
analyze: (id: string): Promise<Protocol> =>
apiFetch(`/api/protocols/${id}/analyze`, {
method: 'POST',
}).then(r => r.json()),
remove: (id: string): Promise<void> =>
apiFetch(`/api/protocols/${id}`, { method: 'DELETE' }).then(() => undefined),
};