Apply suggestion to lib/pleroma/web/activity_pub/transmogrifier.ex

This commit is contained in:
lain 2020-03-31 12:55:25 +00:00
parent 29ab1d9f8d
commit f6835333be

View file

@ -615,8 +615,7 @@ def handle_incoming(%{"type" => "Like"} = data, _options) do
with {_, {:ok, cast_data_sym}} <-
{:casting_data,
data |> LikeValidator.cast_data() |> Ecto.Changeset.apply_action(:insert)},
{_, cast_data} <-
{:stringify_keys, ObjectValidator.stringify_keys(cast_data_sym |> Map.from_struct())},
cast_data = ObjectValidator.stringify_keys(Map.from_struct(cast_data_sym)),
:ok <- ObjectValidator.fetch_actor_and_object(cast_data),
{_, {:ok, cast_data}} <- {:maybe_add_context, maybe_add_context_from_object(cast_data)},
{_, {:ok, cast_data}} <-