Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-03-15 11:30:17 +01:00
parent bfc56040e7
commit d1dc8e6869
6 changed files with 25 additions and 25 deletions

View file

@ -1117,7 +1117,8 @@
%{
key: :order_by_published_at,
type: :boolean,
description: "Order statuses in timelines basing on their declared publication date, instead of insertion date."
description:
"Order statuses in timelines basing on their declared publication date, instead of insertion date."
}
]
},

View file

@ -483,7 +483,7 @@ defp uniq_case_insensitive(strings) do
end
defp find_original_case(string, strings) do
Enum.find(strings, &String.downcase(&1) == string)
Enum.find(strings, &(String.downcase(&1) == string))
end
def get_emoji_reactions(object) do

View file

@ -24,9 +24,7 @@ def collection_operation do
operationId: "AdminAPI.ImportController.collection",
parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
requestBody:
request_body("Parameters", UserImportOperation.import_collection_request(),
required: true
),
request_body("Parameters", UserImportOperation.import_collection_request(), required: true),
responses: %{
200 => ok_response(),
500 => Operation.response("Error", "application/json", ApiError)

View file

@ -79,9 +79,7 @@ def search_operation do
%Schema{type: :string, enum: ["accounts", "hashtags", "statuses"]},
"Search type"
),
Operation.parameter(:q, :query, %Schema{type: :string}, "The search query",
required: true
),
Operation.parameter(:q, :query, %Schema{type: :string}, "The search query", required: true),
Operation.parameter(
:resolve,
:query,

View file

@ -123,24 +123,24 @@ def import_collection_request do
end
def import_archive_request do
%Schema{
type: :object,
required: [:file],
properties: %{
file: %Schema{
description:
"File needs to be uploaded with the multipart request or link to remote file",
anyOf: [
%Schema{type: :string, format: :binary},
%Schema{type: :string, format: :uri}
]
},
keep_unlisted: %Schema{
type: :boolean
}
%Schema{
type: :object,
required: [:file],
properties: %{
file: %Schema{
description:
"File needs to be uploaded with the multipart request or link to remote file",
anyOf: [
%Schema{type: :string, format: :binary},
%Schema{type: :string, format: :uri}
]
},
keep_unlisted: %Schema{
type: :boolean
}
}
end
}
end
defp ok_response do
Operation.response("Ok", "application/json", %Schema{type: :string, example: "ok"})

View file

@ -623,7 +623,10 @@ def translate(
end
@doc "POST /api/v1/bigbuffet/statuses/translate"
def translate_many(%{body_params: %{ids: status_ids} = params, assigns: %{user: user}} = conn, _) do
def translate_many(
%{body_params: %{ids: status_ids} = params, assigns: %{user: user}} = conn,
_
) do
with {:language, language} when is_binary(language) <-
{:language, Map.get(params, :target_language) || user.language},
{:results, results} <-