Merge branch 'add-url-to-admin-account-view' into 'develop'
[akkoma] / lib / pleroma / web / controller_helper.ex
index 9e5444817bc9c8c82f21b8b4467b923e5c17d50c..5d67d75b5fd09bdb5d0cf793e9be5c3abfeccc3d 100644 (file)
@@ -93,8 +93,7 @@ defmodule Pleroma.Web.ControllerHelper do
   end
 
   def assign_account_by_id(conn, _) do
-    # TODO: use `conn.params[:id]` only after moving to OpenAPI
-    case Pleroma.User.get_cached_by_id(conn.params[:id] || conn.params["id"]) do
+    case Pleroma.User.get_cached_by_id(conn.params.id) do
       %Pleroma.User{} = account -> assign(conn, :account, account)
       nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
     end
@@ -111,11 +110,6 @@ defmodule Pleroma.Web.ControllerHelper do
     render_error(conn, :not_implemented, "Can't display this activity")
   end
 
-  @spec put_if_exist(map(), atom() | String.t(), any) :: map()
-  def put_if_exist(map, _key, nil), do: map
-
-  def put_if_exist(map, key, value), do: Map.put(map, key, value)
-
   @doc """
   Returns true if request specifies to include embedded relationships in account objects.
   May only be used in selected account-related endpoints; has no effect for status- or