aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkPherox <admin@mail.kr-kp.com>2019-08-25 07:02:32 +0900
committerAriadne Conill <ariadne@dereferenced.org>2019-10-06 15:14:27 +0000
commit313b134facbed7028bb793590efdbf20fe8ceca6 (patch)
tree42d1fb3cbced6ca5054444bdc36dc0a0548e9655
parent81abee22b6cd75de756a59442ff792a9d1879bd6 (diff)
downloadpleroma-313b134facbed7028bb793590efdbf20fe8ceca6.tar.gz
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/controllers/mastodon_api_controller.ex7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
index a789f8392..4cf95a581 100644
--- a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/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,