Fix some Dializer issue

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-09-26 10:29:37 +02:00
parent 530539c631
commit a37bab3b84
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -62,7 +62,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
Map.merge(map, %{actor: actor, id: id, inserted_at: inserted_at}) Map.merge(map, %{actor: actor, id: id, inserted_at: inserted_at})
end end
@spec transform_action_log(module(), atom(), ActionLog.t()) :: map() @spec transform_action_log(module(), atom(), ActionLog.t()) :: map() | nil
defp transform_action_log( defp transform_action_log(
Report, Report,
:update, :update,
@ -132,6 +132,8 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
} }
end end
defp transform_action_log(_, _, _), do: nil
# Changes are stored as %{"key" => "value"} so we need to convert them back as struct # Changes are stored as %{"key" => "value"} so we need to convert them back as struct
@spec convert_changes_to_struct(module(), map()) :: struct() @spec convert_changes_to_struct(module(), map()) :: struct()
defp convert_changes_to_struct(struct, %{"report_id" => _report_id} = changes) do defp convert_changes_to_struct(struct, %{"report_id" => _report_id} = changes) do