Skip to content

Commit

Permalink
use proper dependent preloads
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Nov 8, 2024
1 parent aaa88c0 commit f56c3e6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/mindwendel/lanes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,7 @@ defmodule Mindwendel.Lanes do

lane_query
|> Repo.all()
|> Repo.preload(
ideas:
ideas_advanced_query
|> preload([
:link,
:likes,
:idea_labels,
:files
])
)
|> Repo.preload(ideas: {ideas_advanced_query, [:link, :likes, :idea_labels, :files]})
end

defp build_ideas_query_with_filter(%{filter_labels_ids: filter_labels_ids}) do
Expand All @@ -128,7 +119,7 @@ defmodule Mindwendel.Lanes do
end

defp build_ideas_query_with_filter(%{} = _filters) do
Idea
from(idea in Idea)
end

@doc """
Expand Down

0 comments on commit f56c3e6

Please sign in to comment.