Add changelog

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2023-12-23 15:51:20 +01:00
parent 6051715a99
commit f6fee39e42
4 changed files with 12 additions and 10 deletions

View File

@ -0,0 +1 @@
Add instance rules

View File

@ -97,6 +97,7 @@ defmodule Pleroma.Web.ApiSpec do
"Frontend managment",
"Instance configuration",
"Instance documents",
"Instance rule managment",
"Invites",
"MediaProxy cache",
"OAuth application managment",

View File

@ -48,7 +48,7 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do
def rules_operation do
%Operation{
tags: ["Instance"],
tags: ["Instance misc"],
summary: "Retrieve list of instance rules",
operationId: "InstanceController.rules",
responses: %{

View File

@ -73,15 +73,6 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
})
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
Pleroma.Rule.query()
|> Pleroma.Repo.all()
@ -95,6 +86,15 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
}
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
[
"pleroma_api",