fix: 任务侧边栏点击详情后"任务不存在"问题
GetTasks 返回的 TaskResponse.ID 使用了数据库自增 ID (t.ID) 而非 ExternalID, 导致前端用错误 ID 调用 GetTask 接口时 external_id 查询不到记录。 改为返回 t.ExternalID 与实际查询字段一致。
This commit is contained in:
@@ -198,7 +198,7 @@ func (s *ProjectService) GetTasks(ctx context.Context, userID uint, projectID ui
|
||||
response := make([]model.TaskResponse, len(tasks))
|
||||
for i, t := range tasks {
|
||||
response[i] = model.TaskResponse{
|
||||
ID: fmt.Sprintf("%d", t.ID),
|
||||
ID: t.ExternalID,
|
||||
ProjectID: fmt.Sprintf("%d", t.ProjectID),
|
||||
Prompt: t.Prompt,
|
||||
AssetType: t.AssetType,
|
||||
|
||||
Reference in New Issue
Block a user