Files
xiaoxia-saas/apps/web/src/api/editPlans.ts
T
Xiaoxia AI 530b31dc10
Deploy / Build Production Runtime Images (push) Successful in 9m19s
Deploy / Deploy Production (push) Failing after 18s
Deploy / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been skipped
feat(plans): add edit plan preview workflow
2026-06-24 10:10:25 +08:00

50 lines
1.2 KiB
TypeScript

import apiClient from './client';
export interface EditTemplateItem {
id: string;
workspace_id: string;
project_id: string;
name: string;
description: string;
target_duration: number;
clip_count: number;
is_active: boolean;
}
export interface EditPlanClipItem {
id: string;
asset_id: string;
asset_name: string;
sequence: number;
start_time: number;
duration: number;
reason: string;
}
export interface EditPlanItem {
id: string;
workspace_id: string;
project_id: string;
template_id: string;
asset_library_id: string;
title_id: string;
status: string;
summary: string;
clips: EditPlanClipItem[];
}
export const getEditTemplates = async (projectId: string, workspaceId: string): Promise<EditTemplateItem[]> => {
const response = await apiClient.get(`/projects/${projectId}/edit-plans/templates`, { params: { workspace_id: workspaceId } });
return response.data;
};
export const createEditPlan = async ({ projectId, data }: { projectId: string; data: {
workspace_id: string;
asset_library_id: string;
template_id?: string;
title_id?: string;
} }): Promise<EditPlanItem> => {
const response = await apiClient.post(`/projects/${projectId}/edit-plans`, data);
return response.data;
};