Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/700
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanminutillo committed Nov 21, 2024
1 parent defa33e commit 34a20d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/live_handlers/posts_live_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions test/support/conn_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34a20d0

Please sign in to comment.