Skip to content

Commit

Permalink
fix: jobs api interval
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadch91 committed Dec 19, 2024
1 parent 4b2da17 commit ebddb3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions services/describe/db/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ UNION ALL
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, framework_id::text AS title, status, failure_message FROM compliance_jobs WHERE created_at >= ? AND created_at <= ?)
)
) AS t %s ORDER BY %s %s LIMIT ? OFFSET ?;
`, whereQuery, sortBy, sortOrder)
} else{
rawQuery = fmt.Sprintf(`
SELECT * FROM (
(SELECT id, created_at, updated_at, 'discovery' AS job_type, integration_id, resource_type AS title, status, failure_message FROM describe_integration_jobs)
UNION ALL
(SELECT id, created_at, updated_at, 'compliance' AS job_type, 'all' AS integration_id, framework_id::text AS title, status, failure_message FROM compliance_jobs)
) AS t %s ORDER BY %s %s LIMIT ? OFFSET ?;
`, whereQuery, sortBy, sortOrder)
}

Expand Down

0 comments on commit ebddb3a

Please sign in to comment.