mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
section 13: Phase 13: Multi-run launcher and run groups in the repo page
This commit is contained in:
1 parent
891f5427b4
commit
444a43aa1d
6 files changed
+674
-4
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { fetchWrapper } from './fetchWrapper'
|
||||
import { API_BASE_URL } from '@/config'
|
||||
import type { LaunchMultiRunRequest, MultiRun } from '@opencode-manager/shared/schemas'
|
||||
|
||||
export async function listMultiRuns(repoId: number): Promise<MultiRun[]> {
|
||||
const res = await fetchWrapper<{ runs: MultiRun[] }>(`${API_BASE_URL}/api/multi-runs`, {
|
||||
params: { repoId },
|
||||
})
|
||||
return res.runs
|
||||
}
|
||||
|
||||
export async function launchMultiRun(request: LaunchMultiRunRequest): Promise<MultiRun> {
|
||||
const res = await fetchWrapper<{ run: MultiRun }>(`${API_BASE_URL}/api/multi-runs`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(request),
|
||||
})
|
||||
return res.run
|
||||
}
|
||||
|
||||
export async function discardMultiRunEntry(runId: number, entryId: number): Promise<MultiRun> {
|
||||
const res = await fetchWrapper<{ run: MultiRun }>(
|
||||
`${API_BASE_URL}/api/multi-runs/${encodeURIComponent(runId)}/entries/${encodeURIComponent(entryId)}/discard`,
|
||||
{ method: 'POST' },
|
||||
)
|
||||
return res.run
|
||||
}
|
||||
Reference in new issue
Block a user