Make the emoji controller api more RESTy
authorEkaterina Vaartis <vaartis@cock.li>
Wed, 11 Sep 2019 18:50:55 +0000 (21:50 +0300)
committerEkaterina Vaartis <vaartis@cock.li>
Wed, 18 Sep 2019 21:16:33 +0000 (00:16 +0300)
lib/pleroma/web/router.ex
test/web/emoji_api_controller_test.exs

index 17f7406fdf21c94fec22be52eb7c8c9ca1ec0093..bae25c60a011616ee55f34fa40a674d60529dd43 100644 (file)
@@ -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
 
index 7942a7b017a53dc960282a88f6329679c3e90f25..e92e92f747c6b3ae342c2dc5407ca99a5474466a 100644 (file)
@@ -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,