commit: d26a4493960cc9d99183dfcd18464040213ac91e
parent 435bf1f9450954eab5f753a983dee202aa11bac1
Author: Egor Kislitsyn <egor@kislitsyn.com>
Date: Wed, 11 Nov 2020 20:39:57 +0400
Change endpoint path
Diffstat:
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md
@@ -1525,8 +1525,7 @@ Returns the content of the document
]
```
-
-## `POST /api/pleroma/admin/frontends
+## `POST /api/pleroma/admin/frontends/install
### Install a frontend
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
@@ -245,7 +245,7 @@ defmodule Pleroma.Web.Router do
delete("/chats/:id/messages/:message_id", ChatController, :delete_message)
get("/frontends", FrontendController, :index)
- post("/frontends", FrontendController, :install)
+ post("/frontends/install", FrontendController, :install)
post("/backups", AdminAPIController, :create_backup)
end
diff --git a/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs b/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs
@@ -44,7 +44,7 @@ defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do
end
end
- describe "POST /api/pleroma/admin/frontends" do
+ describe "POST /api/pleroma/admin/frontends/install" do
test "from available frontends", %{conn: conn} do
clear_config([:frontends, :available], %{
"pleroma" => %{
@@ -60,7 +60,7 @@ defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do
conn
|> put_req_header("content-type", "application/json")
- |> post("/api/pleroma/admin/frontends", %{name: "pleroma"})
+ |> post("/api/pleroma/admin/frontends/install", %{name: "pleroma"})
|> json_response_and_validate_schema(:ok)
assert File.exists?(Path.join([@dir, "frontends", "pleroma", "fantasy", "test.txt"]))
@@ -92,7 +92,7 @@ defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do
conn
|> put_req_header("content-type", "application/json")
- |> post("/api/pleroma/admin/frontends", %{
+ |> post("/api/pleroma/admin/frontends/install", %{
name: "pleroma",
file: "test/fixtures/tesla_mock/frontend.zip"
})
@@ -108,7 +108,7 @@ defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do
conn
|> put_req_header("content-type", "application/json")
- |> post("/api/pleroma/admin/frontends", %{
+ |> post("/api/pleroma/admin/frontends/install", %{
name: "unknown",
ref: "baka",
build_url: "http://gensokyo.2hu/madeup.zip",