From: Ekaterina Vaartis Date: Wed, 11 Sep 2019 18:50:55 +0000 (+0300) Subject: Make the emoji controller api more RESTy X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=6cd651a38be898456c06d8fee7fd15f1b406848c;p=akkoma Make the emoji controller api more RESTy --- diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 17f7406fd..bae25c60a 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -220,17 +220,17 @@ defmodule Pleroma.Web.Router do post("/import_from_fs", EmojiAPIController, :import_from_fs) - post("/update_file/:pack_name", EmojiAPIController, :update_file) - post("/update_metadata/:pack_name", EmojiAPIController, :update_metadata) - post("/create/:name", EmojiAPIController, :create) - delete("/delete/:name", EmojiAPIController, :delete) + post("/:pack_name/update_file", EmojiAPIController, :update_file) + post("/:pack_name/update_metadata", EmojiAPIController, :update_metadata) + put("/:name", EmojiAPIController, :create) + delete("/:name", EmojiAPIController, :delete) post("/download_from", EmojiAPIController, :download_from) end scope "/packs" do # Pack info / downloading get("/", EmojiAPIController, :list_packs) - get("/download_shared/:name", EmojiAPIController, :download_shared) + get("/:name/download_shared/", EmojiAPIController, :download_shared) end end diff --git a/test/web/emoji_api_controller_test.exs b/test/web/emoji_api_controller_test.exs index 7942a7b01..e92e92f74 100644 --- a/test/web/emoji_api_controller_test.exs +++ b/test/web/emoji_api_controller_test.exs @@ -343,7 +343,7 @@ defmodule Pleroma.Web.EmojiAPI.EmojiAPIControllerTest do assert conn |> put_req_header("content-type", "application/json") - |> post( + |> put( emoji_api_path( conn, :create,