mirror of
https://github.com/ash-project/ash_phoenix.git
synced 2024-09-20 07:12:49 +12:00
fix: don't raise on unknown inputs for filters
This commit is contained in:
parent
b7a9ea6502
commit
638ec3f93c
2 changed files with 7 additions and 4 deletions
|
@ -1212,8 +1212,8 @@ defmodule AshPhoenix.FilterForm do
|
|||
to_form(form, phoenix_form, :components, [])
|
||||
end
|
||||
|
||||
def input_value(_, _, field) do
|
||||
raise "Invalid filter form field #{field}. Only :id, :negated, and :operator are supported"
|
||||
def input_value(_, _, _field) do
|
||||
nil
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
|
@ -111,8 +111,11 @@ defmodule AshPhoenix.FilterForm.Predicate do
|
|||
def input_value(%{negated?: negated?}, _, :negated), do: negated?
|
||||
def input_value(%{path: path}, _, :path), do: Enum.join(path, ".")
|
||||
|
||||
def input_value(_, _, field) do
|
||||
raise "Invalid filter form field #{field}. Only :id, :negated, :operator, :field, :path, :value are supported"
|
||||
def input_value(_, _, _field) do
|
||||
nil
|
||||
|
||||
# We can't raise here
|
||||
# raise "Invalid filter form field #{field}. Only :id, :negated, :operator, :field, :path, :value are supported"
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
Loading…
Reference in a new issue