Include TotalSummary in kanban board task responses
Add summary field to KanbanBoardResponse so clients can update dashboard stats without making a separate /summary API call. This reduces network calls when refreshing task data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,7 @@ type KanbanBoardResponse struct {
|
|||||||
Columns []KanbanColumnResponse `json:"columns"`
|
Columns []KanbanColumnResponse `json:"columns"`
|
||||||
DaysThreshold int `json:"days_threshold"`
|
DaysThreshold int `json:"days_threshold"`
|
||||||
ResidenceID string `json:"residence_id"`
|
ResidenceID string `json:"residence_id"`
|
||||||
|
Summary *TotalSummary `json:"summary,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: TaskCompletionListResponse pagination removed - returns arrays directly
|
// Note: TaskCompletionListResponse pagination removed - returns arrays directly
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ func (s *TaskService) ListTasks(userID uint) (*responses.KanbanBoardResponse, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp := responses.NewKanbanBoardResponseForAll(board)
|
resp := responses.NewKanbanBoardResponseForAll(board)
|
||||||
|
// Include summary for dashboard stats
|
||||||
|
summary := s.getSummaryForUser(userID)
|
||||||
|
resp.Summary = &summary
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +148,9 @@ func (s *TaskService) GetTasksByResidence(residenceID, userID uint, daysThreshol
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp := responses.NewKanbanBoardResponse(board, residenceID)
|
resp := responses.NewKanbanBoardResponse(board, residenceID)
|
||||||
|
// Include summary for dashboard stats
|
||||||
|
summary := s.getSummaryForUser(userID)
|
||||||
|
resp.Summary = &summary
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user