Rewrite block fetch query

This commit is contained in:
Francis Dinh 2018-05-24 13:26:59 -04:00
parent 72b93d13f8
commit 1197ec10a8
1 changed files with 2 additions and 1 deletions

View File

@ -366,8 +366,9 @@ def fetch_latest_block(%User{ap_id: blocker_id}, %User{ap_id: blocked_id}) do
fragment(
"? @> ?",
activity.data,
^%{type: "Block", actor: blocker_id, object: blocked_id}
^%{type: "Block", object: blocked_id}
),
where: activity.actor == ^blocker_id,
order_by: [desc: :id],
limit: 1
)