Fix type of fields_attributes
Convert tuple list to map list when parameters is `:urlencoded` or `:multipart`
This commit is contained in:
parent
81abee22b6
commit
313b134fac
|
@ -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