feat: add frontend API clients for branches, handoffs, and resolutions
Adds branchesApi (getBranches, createFork, updateBranchStatus, switchBranch, reviveBranch, sendBranchMessage), handoffsApi (createHandoff, listHandoffs, claimHandoff, getQueue), and resolutionsApi (getOutputs, editOutput, pushOutput). All exported from api/index.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
42
frontend/src/api/resolutions.ts
Normal file
42
frontend/src/api/resolutions.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import apiClient from './client'
|
||||
import type {
|
||||
AllResolutionOutputsResponse,
|
||||
ResolutionOutputResponse,
|
||||
ResolutionOutputEditRequest,
|
||||
ResolutionOutputPushRequest,
|
||||
} from '@/types/branching'
|
||||
|
||||
export const resolutionsApi = {
|
||||
async getOutputs(sessionId: string): Promise<AllResolutionOutputsResponse> {
|
||||
const response = await apiClient.get<AllResolutionOutputsResponse>(
|
||||
`/ai-sessions/${sessionId}/resolution-outputs`
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
async editOutput(
|
||||
sessionId: string,
|
||||
outputId: string,
|
||||
data: ResolutionOutputEditRequest
|
||||
): Promise<ResolutionOutputResponse> {
|
||||
const response = await apiClient.patch<ResolutionOutputResponse>(
|
||||
`/ai-sessions/${sessionId}/resolution-outputs/${outputId}`,
|
||||
data
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
async pushOutput(
|
||||
sessionId: string,
|
||||
outputId: string,
|
||||
data: ResolutionOutputPushRequest
|
||||
): Promise<ResolutionOutputResponse> {
|
||||
const response = await apiClient.post<ResolutionOutputResponse>(
|
||||
`/ai-sessions/${sessionId}/resolution-outputs/${outputId}/push`,
|
||||
data
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
export default resolutionsApi
|
||||
Reference in New Issue
Block a user