mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
Merge pull request #1797 from GSA/2709-bug-sorting-error-on-activity-page
Updated the job listing query to sort by the most recent activity
This commit is contained in:
@@ -75,7 +75,9 @@ def dao_get_jobs_by_service_id(
|
||||
stmt = (
|
||||
select(Job)
|
||||
.where(*query_filter)
|
||||
.order_by(Job.processing_started.desc(), Job.created_at.desc())
|
||||
.order_by(
|
||||
func.coalesce(Job.processing_started, Job.created_at).desc(), Job.id.desc()
|
||||
)
|
||||
.limit(page_size)
|
||||
.offset(offset)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user