diff options
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 6c450eb..2187c34 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3161,3 +3161,15 @@ export async function deleteDirective(id: string): Promise<void> { } } +export async function startDirective(id: string): Promise<Directive> { + const res = await authFetch(`${API_BASE}/api/v1/directives/${id}/start`, { + method: "POST", + }); + if (!res.ok) { + const body = await res.json().catch(() => null); + const msg = body?.message || res.statusText; + throw new Error(`Failed to start directive: ${msg}`); + } + return res.json(); +} + |
