Merge pull request #471 from techpixel/filter-by-category

allow filtering by category on the stats endpoint
This commit is contained in:
Kartikey Chauhan
2025-08-17 04:18:26 +05:30
committed by GitHub

View File

@@ -82,6 +82,11 @@ class Api::V1::StatsController < ApplicationController
query = query.where(project: filter_by_project)
end
if params[:filter_by_category].present?
filter_by_category = params[:filter_by_category].split(",")
query = query.where(category: filter_by_category)
end
# do the boundary thingie if requested
use_boundary_aware = params[:boundary_aware] == "true"
total_seconds = if use_boundary_aware