MCPcopy Create free account
hub / github.com/agent-tower/core / useCreateTask

Function useCreateTask

packages/web/src/hooks/use-tasks.ts:146–161  ·  view source on GitHub ↗
(projectId: string)

Source from the content-addressed store, hash-verified

144
145/**
146 * 获取项目的任务列表(支持分页和状态过滤)
147 * GET /api/projects/:projectId/tasks
148 */
149export function useTasks(projectId: string, options?: ListTasksParams) {
150 const params: Record<string, string> = {}
151 if (options?.status != null) params.status = options.status
152 if (options?.page != null) params.page = String(options.page)
153 if (options?.limit != null) params.limit = String(options.limit)
154
155 return useQuery({
156 queryKey: queryKeys.tasks.list(projectId, options as Record<string, unknown> | undefined),
157 queryFn: () =>
158 apiClient.get<PaginatedResponse<Task>>(
159 `/projects/${projectId}/tasks`,
160 { params },
161 ),
162 enabled: !!projectId,
163 })
164}

Callers

nothing calls this directly

Calls 2

postMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected