From 0af510035fea51258575779ab141445d6948e720 Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 25 Sep 2026 00:56:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A5=E5=85=A5=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=8E=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/projects/api.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/projects/api.ts b/src/features/projects/api.ts index 47485a0..8c90721 100644 --- a/src/features/projects/api.ts +++ b/src/features/projects/api.ts @@ -1,6 +1,6 @@ import { request, optionalResource } from '../../lib/http' import type { Checkpoint } from '../workflows/types' -import type { CreateProjectInput, DramaState, Project, ProjectDetail } from './types' +import type { CreateProjectInput, DramaState, Project, ProjectDetail, UpdateProjectInput } from './types' /** 项目与 Create Drama API;路径严格对应后端 dev。 */ export const projectsApi = { @@ -9,6 +9,10 @@ export const projectsApi = { request(`/projects/${encodeURIComponent(id)}`, { signal }), create: (input: CreateProjectInput) => request<{ projectId: string; status: string }>('/projects', { method: 'POST', body: input }), + update: (id: string, input: UpdateProjectInput) => + request(`/projects/${encodeURIComponent(id)}`, { method: 'PUT', body: input }), + delete: (id: string) => + request<{ id: string; deleted: boolean }>(`/projects/${encodeURIComponent(id)}`, { method: 'DELETE' }), state: (id: string, signal?: AbortSignal) => optionalResource(request(`/projects/${encodeURIComponent(id)}/state`, { signal })), checkpoints: (id: string, signal?: AbortSignal) =>