fix: Patch for new Form Access Protocol (#77)

This commit is contained in:
George Anderson 2023-03-09 11:39:53 -08:00 committed by GitHub
parent 9c55b18a2c
commit 336b3c051f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -963,6 +963,10 @@ defmodule AshPhoenix.FilterForm do
def input_value(%{id: id}, _, :id), do: id
def input_value(%{negated?: negated?}, _, :negated), do: negated?
def input_value(%{operator: operator}, _, :operator), do: operator
def input_value(form, phoenix_form, :components) 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"