From 44df6d547bd97df13d80a48e00e415f05863b300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 16 Mar 2023 20:41:51 +0100 Subject: [PATCH] Fix profile fields update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- lib/pleroma/web/api_spec/schemas/status.ex | 20 +++++++++---------- .../controllers/account_controller.ex | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex index 7993f8f7d9..472c322f80 100644 --- a/lib/pleroma/web/api_spec/schemas/status.ex +++ b/lib/pleroma/web/api_spec/schemas/status.ex @@ -153,6 +153,11 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do description: "A map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`" }, + content_type: %Schema{ + type: :string, + nullable: true, + description: "A MIME type of the status" + }, context: %Schema{ type: :string, description: "The thread identifier the status is associated with" @@ -182,6 +187,11 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do } } }, + event: %Schema{ + allOf: [Event], + nullable: true, + description: "The event attached to the status" + }, expires_at: %Schema{ type: :string, format: "date-time", @@ -241,16 +251,6 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do nullable: true, description: "A datetime (ISO 8601) that states when the post was pinned or `null` if the post is not pinned" - }, - content_type: %Schema{ - type: :string, - nullable: true, - description: "A MIME type of the status" - }, - event: %Schema{ - allOf: [Event], - nullable: true, - description: "The event attached to the status" } } }, diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 5c2588b249..0193304a86 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -270,7 +270,7 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p defp normalize_fields_attributes(fields) do if Enum.all?(fields, &is_tuple/1) do Enum.map(fields, fn {_, %{} = field} -> - %{"name" => field["name"], "value" => field["value"]} + %{"name" => field.name, "value" => field.value} end) else Enum.map(fields, fn