diff --git a/lib/live_handlers/posts_live_handler.ex b/lib/live_handlers/posts_live_handler.ex index 34b6404..67e055a 100644 --- a/lib/live_handlers/posts_live_handler.ex +++ b/lib/live_handlers/posts_live_handler.ex @@ -19,9 +19,12 @@ defmodule Bonfire.Posts.LiveHandler do # if not a message, it's a post by default def handle_event("post", params, socket) do debug(params, "post_paramssss") + upload_metadata = params["upload_metadata"] attrs = params + # Remove upload_metadata before conversion + |> Map.delete("upload_metadata") |> input_to_atoms( discard_unknown_keys: false, also_discard_unknown_nested_keys: false, @@ -34,7 +37,7 @@ defmodule Bonfire.Posts.LiveHandler do current_user = current_user_required!(socket) with %{valid?: true} <- post_changeset(attrs, current_user), - uploaded_media <- live_upload_files(current_user, params["upload_metadata"], socket), + uploaded_media <- live_upload_files(current_user, upload_metadata, socket), opts <- [ # current_user: current_user, diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 519b5e3..5d8a51c 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -27,6 +27,8 @@ defmodule Bonfire.UI.Posts.ConnCase do import Phoenix.LiveViewTest import Surface.LiveViewTest + + import PhoenixTest # import Bonfire.UI.Posts.ConnCase import Bonfire.UI.Posts.Test.ConnHelpers import Bonfire.UI.Posts.Test.FakeHelpers