(ctx context.Context, query Query)
| 1628 | } |
| 1629 | |
| 1630 | func (m *Service) listTaskSummaries(ctx context.Context, query Query) ([]Summary, error) { |
| 1631 | summaries, err := m.store.ListTasks(ctx, query) |
| 1632 | if err != nil { |
| 1633 | return nil, err |
| 1634 | } |
| 1635 | |
| 1636 | enriched := make([]Summary, 0, len(summaries)) |
| 1637 | for idx := range summaries { |
| 1638 | item, err := m.enrichTaskSummary(ctx, &summaries[idx]) |
| 1639 | if err != nil { |
| 1640 | return nil, err |
| 1641 | } |
| 1642 | enriched = append(enriched, item) |
| 1643 | } |
| 1644 | return enriched, nil |
| 1645 | } |
| 1646 | |
| 1647 | func (m *Service) enrichTaskSummary(ctx context.Context, summary *Summary) (Summary, error) { |
| 1648 | childCount, err := m.store.CountDirectChildren(ctx, summary.ID) |
no test coverage detected