Skip to content

Commit fd6f0b5

Browse files
committed
address comments
1 parent 5b522ad commit fd6f0b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/models/storage_dashboard.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (db *Database) GetJobsCountThisMonth(orgID uint) (int64, error) {
3030
Joins("JOIN digger_batches ON digger_jobs.batch_id = digger_batches.id").
3131
Joins("JOIN github_app_installation_links ON digger_batches.github_installation_id = github_app_installation_links.github_installation_id").
3232
Joins("JOIN organisations ON github_app_installation_links.organisation_id = organisations.id").
33-
Where("digger_jobs.created_at >= ?", thirtyDaysAgo).
33+
Where("digger_jobs.created_at >= ? AND organisations.id = ?", thirtyDaysAgo, orgID).
3434
Count(&count)
3535

3636
if result.Error != nil {
@@ -49,7 +49,7 @@ func (db *Database) GetSuccessfulJobsCountThisMonth(orgID uint) (int64, error) {
4949
Joins("JOIN digger_batches ON digger_jobs.batch_id = digger_batches.id").
5050
Joins("JOIN github_app_installation_links ON digger_batches.github_installation_id = github_app_installation_links.github_installation_id").
5151
Joins("JOIN organisations ON github_app_installation_links.organisation_id = organisations.id").
52-
Where("digger_jobs.created_at >= ?", thirtyDaysAgo).
52+
Where("digger_jobs.created_at >= ? AND organisations.id = ?", thirtyDaysAgo, orgID).
5353
Where("digger_jobs.status = ?", scheduler.DiggerJobSucceeded).
5454
Count(&count)
5555

0 commit comments

Comments
 (0)