Skip to content

Commit 970b920

Browse files
committed
fix: filter open bounties by ticket state
1 parent 4335a6d commit 970b920

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/algora/bounties/bounties.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,11 @@ defmodule Algora.Bounties do
10521052
open_bounties_query =
10531053
from b in Bounty,
10541054
join: u in assoc(b, :owner),
1055+
join: t in assoc(b, :ticket),
10551056
where: u.id == ^org_id,
1056-
where: b.status == :open
1057+
where: b.status == :open,
1058+
# TODO: persist state as separate field
1059+
where: fragment("(?->>'state' != 'closed')", t.provider_meta)
10571060

10581061
rewards_query =
10591062
from t in Transaction,

0 commit comments

Comments
 (0)