mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Merge pull request #471 from techpixel/filter-by-category
allow filtering by category on the stats endpoint
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user