optimize follow_request_count for own account view

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk 2025-10-14 07:38:59 +02:00 committed by Henry Jameson
commit 5068e31583

View file

@ -361,8 +361,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
) do
count =
user
|> User.get_follow_requests()
|> length()
|> User.get_follow_requests_query()
|> Pleroma.Repo.aggregate(:count)
data
|> Kernel.put_in([:follow_requests_count], count)