auto-sync: 2026-05-20 23:37:49

This commit is contained in:
cfdaily
2026-05-20 23:37:49 +08:00
parent 4b8ecbc98d
commit d74a17cabb
+4 -4
View File
@@ -236,14 +236,14 @@ export const api = {
createTask: async (data: CreateTaskPayload): Promise<ActionResult & { taskId?: string }> => {
try {
const pid = _currentProjectId || Object.keys((await api.projects()).projects)[0];
if (!pid) return { ok: false, error: 'No project selected' };
// 优先用 CreateTaskModal 传入的 project_type(实际是 projectId),其次用当前选中项目
const pid = data.project_type || _currentProjectId || '_general';
const prio = typeof data.priority === 'string' ? parseInt(data.priority, 10) || 5 : 5;
// title 为空时不传,后端自动生成description 前30字 + …)
// title 为空时不传,后端自动生成
const payload: any = {
id: `task-${Date.now().toString(36)}`,
description: data.requirement || data.title || '',
task_type: data.project_type || 'general',
task_type: 'general',
priority: prio,
assigned_by: 'user',
};