diff options
| author | soryu <soryu@soryu.co> | 2026-02-07 16:36:19 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-07 16:36:19 +0000 |
| commit | 1b72449496ce3a057a43d002c8042d5e7a1d6576 (patch) | |
| tree | f9151df7cc5128499ee91aafde3ff3c3b3281c1e /makima/frontend/src/lib/api.ts | |
| parent | 9e9f18884c78c21f5785908fb7ccd00e2fa5436b (diff) | |
| download | soryu-1b72449496ce3a057a43d002c8042d5e7a1d6576.tar.gz soryu-1b72449496ce3a057a43d002c8042d5e7a1d6576.zip | |
Add directive init mechanism
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(); +} + |
