import client from "./client"; import type { ProcedureSuggestion } from "../types/models"; /** List pending procedure suggestions, scoped to the caller's team (admins see both). */ export async function getProcedureSuggestions(): Promise { const { data } = await client.get("/procedure-suggestions"); return data; } /** List pending suggestions tied to a specific test — powers the blocking * review popup a lead sees when opening a test that has one awaiting them. */ export async function getProcedureSuggestionsForTest(testId: string): Promise { const { data } = await client.get(`/procedure-suggestions/for-test/${testId}`); return data; } /** Approve a suggestion — writes it into the template's suggested-procedure field. */ export async function approveProcedureSuggestion(id: string): Promise { const { data } = await client.post(`/procedure-suggestions/${id}/approve`); return data; } /** Reject a suggestion — the template is left untouched. */ export async function rejectProcedureSuggestion(id: string): Promise { const { data } = await client.post(`/procedure-suggestions/${id}/reject`); return data; }