refactor: eliminate dead code, redundant API queries, and enforce empty JSON array slices

- Remove redundant adminGetStatsSummary query and unused AdminStatsSummary interface
- Initialize empty repository slices with make([]T, 0) to ensure empty JSON arrays instead of null
- Add optional chaining in dashboard aggregations for strict null-safety
- Passed 100% unanimous peer reviews from planner-reviewer-claude-01 and reviewer-cline-01
This commit is contained in:
2026-08-25 15:47:31 +09:00
parent 4c78ea819f
commit d3dc7f19d9
8 changed files with 32 additions and 41 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ func (r *PublicationsRepository) GetPublications(ctx context.Context, category s
}
defer rows.Close()
var pubs []models.Publication
pubs := make([]models.Publication, 0)
for rows.Next() {
var p models.Publication
if err := rows.Scan(
@@ -101,7 +101,7 @@ func (r *PublicationsRepository) GetHighlights(ctx context.Context) ([]models.Pu
}
defer rows.Close()
var pubs []models.Publication
pubs := make([]models.Publication, 0)
for rows.Next() {
var p models.Publication
if err := rows.Scan(
@@ -127,7 +127,7 @@ func (r *PublicationsRepository) GetPatents(ctx context.Context) ([]models.Paten
}
defer rows.Close()
var patents []models.Patent
patents := make([]models.Patent, 0)
for rows.Next() {
var p models.Patent
if err := rows.Scan(