mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
improvement: reselect explicitly selected queries on reload
This commit is contained in:
parent
7ea8c38095
commit
eeeab08d32
1 changed files with 6 additions and 0 deletions
|
@ -714,6 +714,11 @@ defmodule Ash.Actions.Read do
|
|||
|
||||
must_be_reselected =
|
||||
if request_opts[:initial_data] do
|
||||
# If there wasn't an explicit query select
|
||||
# done by calling `Ash.Query.ensure_selected` or `Ash.Query.select`
|
||||
# then we don't reselect them
|
||||
query_selects = List.wrap(ash_query.select)
|
||||
|
||||
calc_selects =
|
||||
Enum.flat_map(calculations_at_runtime, fn %{select: select} ->
|
||||
List.wrap(select)
|
||||
|
@ -735,6 +740,7 @@ defmodule Ash.Actions.Read do
|
|||
end
|
||||
end)
|
||||
|> Enum.concat(calc_selects)
|
||||
|> Enum.concat(query_selects)
|
||||
|> remove_already_selected(request_opts[:initial_data])
|
||||
else
|
||||
[]
|
||||
|
|
Loading…
Reference in a new issue