diff options
author | kPherox <admin@mail.kr-kp.com> | 2019-08-25 07:02:32 +0900 |
---|---|---|
committer | kPherox <admin@mail.kr-kp.com> | 2019-08-25 07:34:14 +0900 |
commit | 705b5adfc436b18ab3d1b8ff94274d9a2a6a6912 (patch) | |
tree | 005283e8e0752d1a4ce6da0665f46a86511d4846 | |
parent | 45e21a9df4a7b58d28624534fdde3dc9e31c6813 (diff) | |
download | pleroma-705b5adfc436b18ab3d1b8ff94274d9a2a6a6912.tar.gz pleroma-705b5adfc436b18ab3d1b8ff94274d9a2a6a6912.zip |
Fix type of fields_attributes
Convert tuple list to map list when parameters is `:urlencoded` or `:multipart`
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 98b2e75f3..2826cee8c 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -143,6 +143,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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, |