(options?: ListProjectsParams)
| 72 | * GET /api/projects |
| 73 | */ |
| 74 | export function useProjects(options?: ListProjectsParams) { |
| 75 | const params: Record<string, string> = {} |
| 76 | if (options?.page != null) params.page = String(options.page) |
| 77 | if (options?.limit != null) params.limit = String(options.limit) |
| 78 | if (options?.includeArchived) params.includeArchived = 'true' |
| 79 | |
| 80 | return useQuery({ |
| 81 | queryKey: queryKeys.projects.list(options as Record<string, unknown> | undefined), |
| 82 | queryFn: () => |
| 83 | apiClient.get<PaginatedResponse<Project>>('/projects', { params }), |
| 84 | }) |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * 获取项目详情(含任务统计) |
no test coverage detected