fix: use @user.heartbeats to only filter heartbeats by user

This commit is contained in:
Kartikey Chauhan 2026-03-25 14:42:24 +05:30
parent 725048c864
commit 91a0daf23f

View file

@ -48,7 +48,7 @@ class Api::V1::StatsController < ApplicationController
scope = nil
if params[:filter_by_project].present?
filter_by_project = params[:filter_by_project].split(",")
scope = Heartbeat.where(project: filter_by_project)
scope = @user.heartbeats.where(project: filter_by_project)
end
limit = params[:limit].to_i