d31e30c494
Deploy / Build Production Runtime Images (push) Successful in 9m7s
Deploy / Deploy Production (push) Successful in 44s
Deploy / Production Browser E2E (push) Successful in 33s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been skipped
28 lines
804 B
TypeScript
28 lines
804 B
TypeScript
import apiClient from './client';
|
|
|
|
export interface ProjectTaskItem {
|
|
id: string;
|
|
task_type: 'ingest' | 'generation' | string;
|
|
workspace_id: string;
|
|
project_id: string;
|
|
status: string;
|
|
progress: number;
|
|
current_step: string;
|
|
error_message: string;
|
|
user_message: string;
|
|
retryable: boolean;
|
|
source_id: string;
|
|
created_at?: string | null;
|
|
updated_at?: string | null;
|
|
}
|
|
|
|
export const getProjectTasks = async (projectId: string): Promise<ProjectTaskItem[]> => {
|
|
const response = await apiClient.get(`/projects/${projectId}/tasks`);
|
|
return response.data.items;
|
|
};
|
|
|
|
export const retryProjectTask = async (taskType: string, sourceId: string): Promise<ProjectTaskItem> => {
|
|
const response = await apiClient.post(`/tasks/${taskType}/${sourceId}/retry`);
|
|
return response.data;
|
|
};
|