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
1 changed files with 7 additions and 0 deletions
|
@ -143,6 +143,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
|> Enum.concat(Formatter.get_emoji_map(emojis_text))
|
|> Enum.concat(Formatter.get_emoji_map(emojis_text))
|
||||||
|> Enum.dedup()
|
|> 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 =
|
info_params =
|
||||||
[
|
[
|
||||||
:no_rich_text,
|
:no_rich_text,
|
||||||
|
|
Loading…
Reference in a new issue