[#1304] Moved remaining fields from User.Info to User.

Misc. fixes / improvements.
This commit is contained in:
Ivan Tashkinov 2019-10-20 13:42:42 +03:00
commit e8843974cb
14 changed files with 355 additions and 205 deletions

View file

@ -197,11 +197,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
|> Enum.dedup()
user_params = Map.put(user_params, :emoji, user_emojis)
changeset =
user
|> User.update_changeset(user_params)
|> User.change_info(& &1)
changeset = User.update_changeset(user, user_params)
with {:ok, user} <- User.update_and_set_cache(changeset) do
if original_user != user, do: CommonAPI.update(user)

View file

@ -21,8 +21,8 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockController do
plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
@doc "GET /api/v1/domain_blocks"
def index(%{assigns: %{user: %{info: info}}} = conn, _) do
json(conn, Map.get(info, :domain_blocks, []))
def index(%{assigns: %{user: user}} = conn, _) do
json(conn, Map.get(user, :domain_blocks, []))
end
@doc "POST /api/v1/domain_blocks"