Fix type of fields_attributes
Convert tuple list to map list when parameters is `:urlencoded` or `:multipart`
This commit is contained in:
parent
45e21a9df4
commit
705b5adfc4
|
@ -143,6 +143,13 @@ def update_credentials(%{assigns: %{user: user}} = conn, params) do
|
|||
|> Enum.concat(Formatter.get_emoji_map(emojis_text))
|
||||
|> Enum.dedup()
|
||||
|
||||
params =
|
||||
if Map.has_key?(params, "fields_attributes") && Enum.all?(params["fields_attributes"], &is_tuple/1) do
|
||||
Map.update!(params, "fields_attributes", &Enum.map(&1, fn {_, v} -> v end))
|
||||
else
|
||||
params
|
||||
end
|
||||
|
||||
info_params =
|
||||
[
|
||||
:no_rich_text,
|
||||
|
|
Loading…
Reference in New Issue