Skip to content

Commit 78d72f7

Browse files
committed
add new option to list_jobs query
1 parent 28e34e0 commit 78d72f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/algora/jobs/jobs.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ defmodule Algora.Jobs do
8080

8181
defp maybe_filter_by_user(query, opts) do
8282
cond do
83+
opts[:user_ids] ->
84+
where(query, [j], j.user_id in ^opts[:user_ids] and j.status in [:active, :processing])
85+
8386
opts[:user_id] ->
8487
where(query, [j], j.user_id == ^opts[:user_id] and j.status in [:active, :processing])
8588

@@ -109,6 +112,7 @@ defmodule Algora.Jobs do
109112
defp maybe_filter_by_status(query, opts) do
110113
cond do
111114
opts[:status] == :all -> where(query, [j], j.status in [:active, :processing])
115+
opts[:user_ids] -> where(query, [j], j.status in [:active, :processing])
112116
opts[:user_id] -> where(query, [j], j.status in [:active, :processing])
113117
opts[:handles] && opts[:handles] != [] -> where(query, [j, u], j.status in [:active, :processing])
114118
opts[:handle] -> where(query, [j, u], j.status in [:active, :processing])

0 commit comments

Comments
 (0)