Order favourites and reblogs list from newest to oldest
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
ca03d94f52
commit
21f486c872
3 changed files with 19 additions and 5 deletions
|
|
@ -488,6 +488,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
|
|||
users =
|
||||
User
|
||||
|> Ecto.Query.where([u], u.ap_id in ^likes)
|
||||
|> Ecto.Query.order_by([u], fragment("array_position(?, ?)", ^likes, u.ap_id))
|
||||
|> Repo.all()
|
||||
|> Enum.filter(&(not User.blocks?(user, &1)))
|
||||
|
||||
|
|
@ -523,6 +524,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
|
|||
users =
|
||||
User
|
||||
|> Ecto.Query.where([u], u.ap_id in ^announces)
|
||||
|> Ecto.Query.order_by([u], fragment("array_position(?, ?)", ^announces, u.ap_id))
|
||||
|> Repo.all()
|
||||
|> Enum.filter(&(not User.blocks?(user, &1)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue