mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Fix tests
This commit is contained in:
parent
5af9ce4a01
commit
97f947deaf
2 changed files with 23 additions and 13 deletions
|
@ -227,16 +227,29 @@ defmodule Pleroma.Web.ApiSpec.PleromaEmojiPackOperation do
|
|||
|
||||
defp emoji_packs_response do
|
||||
Operation.response(
|
||||
"Object with pack names as keys and pack contents as values",
|
||||
"Emoji packs and the count",
|
||||
"application/json",
|
||||
%Schema{
|
||||
type: :object,
|
||||
properties: %{
|
||||
packs: %Schema{
|
||||
type: :object,
|
||||
description: "Object with pack names as keys and pack contents as values",
|
||||
additionalProperties: %Schema{
|
||||
emoji_pack()
|
||||
| extensions: %{"x-additionalPropertiesName": "Pack name"}
|
||||
}
|
||||
},
|
||||
count: %Schema{
|
||||
type: :integer,
|
||||
description: "Number of emoji packs"
|
||||
}
|
||||
},
|
||||
example: %{
|
||||
"packs" => %{
|
||||
"emojos" => emoji_pack().example
|
||||
},
|
||||
"count" => 1
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
@ -269,15 +269,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
|
|||
end
|
||||
|
||||
defp normalize_fields_attributes(fields) do
|
||||
if Enum.all?(fields, &is_tuple/1) do
|
||||
Enum.map(fields, fn {_, v} -> v end)
|
||||
else
|
||||
Enum.map(fields, fn
|
||||
if(Enum.all?(fields, &is_tuple/1), do: Enum.map(fields, fn {_, v} -> v end), else: fields)
|
||||
|> Enum.map(fn
|
||||
%{} = field -> %{"name" => field.name, "value" => field.value}
|
||||
field -> field
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
@doc "GET /api/v1/accounts/relationships"
|
||||
def relationships(%{assigns: %{user: user}} = conn, %{id: id}) do
|
||||
|
|
Loading…
Reference in a new issue