Preserve order of mentioned users
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
9983799ccb
commit
1dba3bc4dc
1 changed files with 1 additions and 0 deletions
|
@ -2279,6 +2279,7 @@ defmodule Pleroma.User do
|
||||||
def get_ap_ids_by_nicknames(nicknames) do
|
def get_ap_ids_by_nicknames(nicknames) do
|
||||||
from(u in User,
|
from(u in User,
|
||||||
where: u.nickname in ^nicknames,
|
where: u.nickname in ^nicknames,
|
||||||
|
order_by: fragment("array_position(?, ?)", ^nicknames, u.nickname),
|
||||||
select: u.ap_id
|
select: u.ap_id
|
||||||
)
|
)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
|
Loading…
Reference in a new issue