mirror of
https://github.com/ash-project/ash_phoenix.git
synced 2024-09-20 07:12:49 +12:00
improvement: Remove domain opt from AshPhoenix.LiveView (#167)
This commit is contained in:
parent
b8c2d4034e
commit
94e17780ff
1 changed files with 1 additions and 10 deletions
|
@ -38,11 +38,6 @@ defmodule AshPhoenix.LiveView do
|
||||||
type: :any,
|
type: :any,
|
||||||
doc: "Results to use instead of running the query immediately."
|
doc: "Results to use instead of running the query immediately."
|
||||||
],
|
],
|
||||||
domain: [
|
|
||||||
type: :atom,
|
|
||||||
doc:
|
|
||||||
"For paginated views, in order to use `change_page/3`, you must set the Domain to use for pagination"
|
|
||||||
],
|
|
||||||
refetch_interval: [
|
refetch_interval: [
|
||||||
type: :non_neg_integer,
|
type: :non_neg_integer,
|
||||||
doc: "An interval (in ms) to periodically refetch the query"
|
doc: "An interval (in ms) to periodically refetch the query"
|
||||||
|
@ -219,11 +214,7 @@ defmodule AshPhoenix.LiveView do
|
||||||
data -> data
|
data -> data
|
||||||
end
|
end
|
||||||
|
|
||||||
unless config.opts[:domain] do
|
new_result = Ash.page!(current_page, target)
|
||||||
raise "Must set domain to use change_page/3"
|
|
||||||
end
|
|
||||||
|
|
||||||
new_result = config.opts[:domain].page!(current_page, target)
|
|
||||||
{_query, rerun_opts} = new_result.rerun
|
{_query, rerun_opts} = new_result.rerun
|
||||||
new_page_opts = Keyword.merge(config.opts[:page] || [], rerun_opts[:page])
|
new_page_opts = Keyword.merge(config.opts[:page] || [], rerun_opts[:page])
|
||||||
new_opts = Keyword.put(config.opts, :page, new_page_opts)
|
new_opts = Keyword.put(config.opts, :page, new_page_opts)
|
||||||
|
|
Loading…
Reference in a new issue