[Pleroma.Web.MastodonAPI.StatusView]: Remove nils from lists.json
[akkoma] / lib / pleroma / web / mastodon_api / mastodon_api_controller.ex
index 499635a9df8867d07cf0ce2dde258d58cd710265..cbda069df9c1c02fc46273aaa06465d07373ca15 100644 (file)
@@ -770,6 +770,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     end
   end
 
+  def account_lists(%{assigns: %{user: user}} = conn, %{"id" => account_id}) do
+    lists = Pleroma.List.get_lists_account_belongs(user, account_id)
+    res = ListView.render("lists.json", lists: lists)
+    json(conn, res)
+  end
+
   def delete_list(%{assigns: %{user: user}} = conn, %{"id" => id}) do
     with %Pleroma.List{} = list <- Pleroma.List.get(id, user),
          {:ok, _list} <- Pleroma.List.delete(list) do