Applied relationships preloading to GET /api/v1/accounts/relationships. Refactoring (User.binary_id/1).

This commit is contained in:
Ivan Tashkinov 2020-03-25 17:01:45 +03:00
commit be5e2c4dbb
6 changed files with 30 additions and 23 deletions

View file

@ -24,10 +24,10 @@ defmodule Pleroma.ThreadMute do
end
def query(user_id, context) do
{:ok, user_id} = FlakeId.Ecto.CompatType.dump(user_id)
user_binary_id = User.binary_id(user_id)
ThreadMute
|> Ecto.Query.where(user_id: ^user_id)
|> Ecto.Query.where(user_id: ^user_binary_id)
|> Ecto.Query.where(context: ^context)
end