Skip to content

Commit c06166f

Browse files
committed
refactor: update job ordering logic to handle null values
- Modified the job listing ordering to use `desc_nulls_last` for the maximum inserted_at date, ensuring that jobs with null dates are displayed at the end of the list.
1 parent ba36658 commit c06166f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/algora/jobs/jobs.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule Algora.Jobs do
2626
|> group_by([j, u, i], [u.contract_signed, j.id, j.inserted_at])
2727
|> order_by([j, u, i],
2828
desc: u.contract_signed,
29-
desc: coalesce(max(i.inserted_at), j.inserted_at),
29+
desc_nulls_last: max(i.inserted_at),
3030
desc: j.inserted_at
3131
)
3232
|> maybe_limit(opts[:limit])

0 commit comments

Comments
 (0)