format
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
bfc56040e7
commit
d1dc8e6869
6 changed files with 25 additions and 25 deletions
|
@ -1117,7 +1117,8 @@
|
||||||
%{
|
%{
|
||||||
key: :order_by_published_at,
|
key: :order_by_published_at,
|
||||||
type: :boolean,
|
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."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -483,7 +483,7 @@ defp uniq_case_insensitive(strings) do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp find_original_case(string, strings) do
|
defp find_original_case(string, strings) do
|
||||||
Enum.find(strings, &String.downcase(&1) == string)
|
Enum.find(strings, &(String.downcase(&1) == string))
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_emoji_reactions(object) do
|
def get_emoji_reactions(object) do
|
||||||
|
|
|
@ -24,9 +24,7 @@ def collection_operation do
|
||||||
operationId: "AdminAPI.ImportController.collection",
|
operationId: "AdminAPI.ImportController.collection",
|
||||||
parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
|
parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
|
||||||
requestBody:
|
requestBody:
|
||||||
request_body("Parameters", UserImportOperation.import_collection_request(),
|
request_body("Parameters", UserImportOperation.import_collection_request(), required: true),
|
||||||
required: true
|
|
||||||
),
|
|
||||||
responses: %{
|
responses: %{
|
||||||
200 => ok_response(),
|
200 => ok_response(),
|
||||||
500 => Operation.response("Error", "application/json", ApiError)
|
500 => Operation.response("Error", "application/json", ApiError)
|
||||||
|
|
|
@ -79,9 +79,7 @@ def search_operation do
|
||||||
%Schema{type: :string, enum: ["accounts", "hashtags", "statuses"]},
|
%Schema{type: :string, enum: ["accounts", "hashtags", "statuses"]},
|
||||||
"Search type"
|
"Search type"
|
||||||
),
|
),
|
||||||
Operation.parameter(:q, :query, %Schema{type: :string}, "The search query",
|
Operation.parameter(:q, :query, %Schema{type: :string}, "The search query", required: true),
|
||||||
required: true
|
|
||||||
),
|
|
||||||
Operation.parameter(
|
Operation.parameter(
|
||||||
:resolve,
|
:resolve,
|
||||||
:query,
|
:query,
|
||||||
|
|
|
@ -123,24 +123,24 @@ def import_collection_request do
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_archive_request do
|
def import_archive_request do
|
||||||
%Schema{
|
%Schema{
|
||||||
type: :object,
|
type: :object,
|
||||||
required: [:file],
|
required: [:file],
|
||||||
properties: %{
|
properties: %{
|
||||||
file: %Schema{
|
file: %Schema{
|
||||||
description:
|
description:
|
||||||
"File needs to be uploaded with the multipart request or link to remote file",
|
"File needs to be uploaded with the multipart request or link to remote file",
|
||||||
anyOf: [
|
anyOf: [
|
||||||
%Schema{type: :string, format: :binary},
|
%Schema{type: :string, format: :binary},
|
||||||
%Schema{type: :string, format: :uri}
|
%Schema{type: :string, format: :uri}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
keep_unlisted: %Schema{
|
keep_unlisted: %Schema{
|
||||||
type: :boolean
|
type: :boolean
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
}
|
||||||
|
end
|
||||||
|
|
||||||
defp ok_response do
|
defp ok_response do
|
||||||
Operation.response("Ok", "application/json", %Schema{type: :string, example: "ok"})
|
Operation.response("Ok", "application/json", %Schema{type: :string, example: "ok"})
|
||||||
|
|
|
@ -623,7 +623,10 @@ def translate(
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "POST /api/v1/bigbuffet/statuses/translate"
|
@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) <-
|
with {:language, language} when is_binary(language) <-
|
||||||
{:language, Map.get(params, :target_language) || user.language},
|
{:language, Map.get(params, :target_language) || user.language},
|
||||||
{:results, results} <-
|
{:results, results} <-
|
||||||
|
|
Loading…
Reference in a new issue