|
|
@ -246,7 +246,9 @@ func (l *Loader) FindProject(ctx context.Context, id string) (*models.ProjectRes |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
result.Tasks[i].CompletedAmount = len(result.Tasks[i].Logs) |
|
|
|
for _, log := range result.Tasks[i].Logs { |
|
|
|
result.Tasks[i].CompletedAmount += log.Amount(result.Tasks[i].ItemID) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return result, nil |
|
|
@ -317,8 +319,9 @@ func (l *Loader) ListProjects(ctx context.Context, filter models.ProjectFilter) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
taskResult.CompletedAmount = len(taskResult.Logs) |
|
|
|
|
|
|
|
for _, log := range taskResult.Logs { |
|
|
|
taskResult.CompletedAmount += log.Amount(taskResult.ItemID) |
|
|
|
} |
|
|
|
results[i].Tasks = append(results[i].Tasks, taskResult) |
|
|
|
} |
|
|
|
} |
|
|
@ -346,7 +349,9 @@ func (l *Loader) FindTask(ctx context.Context, id string) (*models.TaskResult, e |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
result.CompletedAmount = len(result.Logs) |
|
|
|
for _, log := range result.Logs { |
|
|
|
result.CompletedAmount += log.Amount(result.ItemID) |
|
|
|
} |
|
|
|
|
|
|
|
return result, nil |
|
|
|
} |
|
|
@ -421,7 +426,9 @@ func (l *Loader) ListTasks(ctx context.Context, filter models.TaskFilter) ([]*mo |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.CompletedAmount = len(result.Logs) |
|
|
|
for _, log := range result.Logs { |
|
|
|
result.CompletedAmount += log.Amount(result.ItemID) |
|
|
|
} |
|
|
|
|
|
|
|
results = append(results, result) |
|
|
|
} |
|
|
|