v1 of protocol checker
All checks were successful
Deploy to Server / deploy (push) Successful in 34s
All checks were successful
Deploy to Server / deploy (push) Successful in 34s
This commit is contained in:
@@ -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),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user