fix: scope page insights to reporting periods

This commit is contained in:
2026-08-22 17:24:37 +08:00
parent 1b6ad4d095
commit 7f9c16be4b
13 changed files with 295 additions and 24 deletions

View File

@@ -258,11 +258,11 @@ func insightScopeQuery(r *http.Request) (string, string, bool) {
return terminalID, periodID, len(terminalID) <= 128 && len(periodID) <= 128
}
func (s *Server) insightPeriod(ctx context.Context, module insight.Module, periodID string) (insight.PeriodScope, bool) {
func (s *Server) insightPeriod(ctx context.Context, _ insight.Module, periodID string) (insight.PeriodScope, bool) {
if periodID == "" {
return insight.PeriodScope{}, true
}
if module != insight.ModuleTransactions || s.analytics == nil {
if s.analytics == nil {
return insight.PeriodScope{}, false
}
periods, err := s.analytics.Periods(ctx)