-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
A particular type of JSON format must be followed to construct a filter. However, no method currently exists to dump a filter to a JSON-encodable format that can be later re-serialized into a filter. The following should work:
import Filtrex.Type.Config
config = defconfig do
text :title
end
{:ok, filter} = Filtrex.parse_params(config, %{"title_contains" => "Buy"})
assert Filtrex.dump(filter) == %{
"filter" => %{
"type" => "all",
"conditions" => [
%{"column" => "title", "comparator" => "contains",
"value" => "Buy", "type" => "text"}
],
"sub_filters" => []
}
Reactions are currently unavailable