Skip to content

Commit

Permalink
fix: return filter
Browse files Browse the repository at this point in the history
  • Loading branch information
DenSmolonski committed Jul 8, 2024
1 parent 8036812 commit 3884a11
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/explorer/lib/explorer/chain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1744,18 +1744,18 @@ defmodule Explorer.Chain do
|> limit(^paging_options.page_size)
|> order_by(desc: :number)
|> join_associations(necessity_by_association)
# |> with_transactions(with_transactions)
|> with_transactions(with_transactions)
|> select_repo(options).all()
end

# defp with_transactions(query, true) do
# from(q in query,
# as: :block,
# where: exists(from(t in Transaction, where: t.block_hash == parent_as(:block).hash))
# )
# end
defp with_transactions(query, true) do
from(q in query,
as: :block,
where: exists(from(t in Transaction, where: t.block_hash == parent_as(:block).hash))
)
end

# defp with_transactions(query, false), do: query
defp with_transactions(query, false), do: query

@doc """
Map `block_number`s to their `t:Explorer.Chain.Block.t/0` `hash` `t:Explorer.Chain.Hash.Full.t/0`.
Expand Down

0 comments on commit 3884a11

Please sign in to comment.