Add changelog
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
6051715a99
commit
f6fee39e42
|
@ -0,0 +1 @@
|
||||||
|
Add instance rules
|
|
@ -97,6 +97,7 @@ def spec(opts \\ []) do
|
||||||
"Frontend managment",
|
"Frontend managment",
|
||||||
"Instance configuration",
|
"Instance configuration",
|
||||||
"Instance documents",
|
"Instance documents",
|
||||||
|
"Instance rule managment",
|
||||||
"Invites",
|
"Invites",
|
||||||
"MediaProxy cache",
|
"MediaProxy cache",
|
||||||
"OAuth application managment",
|
"OAuth application managment",
|
||||||
|
|
|
@ -48,7 +48,7 @@ def peers_operation do
|
||||||
|
|
||||||
def rules_operation do
|
def rules_operation do
|
||||||
%Operation{
|
%Operation{
|
||||||
tags: ["Instance"],
|
tags: ["Instance misc"],
|
||||||
summary: "Retrieve list of instance rules",
|
summary: "Retrieve list of instance rules",
|
||||||
operationId: "InstanceController.rules",
|
operationId: "InstanceController.rules",
|
||||||
responses: %{
|
responses: %{
|
||||||
|
|
|
@ -73,15 +73,6 @@ def render("show2.json", _) do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
defp common_information(instance) do
|
|
||||||
%{
|
|
||||||
languages: Keyword.get(instance, :languages, ["en"]),
|
|
||||||
rules: render(__MODULE__, "rules.json"),
|
|
||||||
title: Keyword.get(instance, :name),
|
|
||||||
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def render("rules.json", _) do
|
def render("rules.json", _) do
|
||||||
Pleroma.Rule.query()
|
Pleroma.Rule.query()
|
||||||
|> Pleroma.Repo.all()
|
|> Pleroma.Repo.all()
|
||||||
|
@ -95,6 +86,15 @@ def render("rule.json", %{rule: rule}) do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp common_information(instance) do
|
||||||
|
%{
|
||||||
|
languages: Keyword.get(instance, :languages, ["en"]),
|
||||||
|
rules: render(__MODULE__, "rules.json"),
|
||||||
|
title: Keyword.get(instance, :name),
|
||||||
|
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def features do
|
def features do
|
||||||
[
|
[
|
||||||
"pleroma_api",
|
"pleroma_api",
|
||||||
|
|
Loading…
Reference in New Issue