Activity: all_non_create_by_object_ap_id_q → by_object_ap_id
This commit is contained in:
parent
b82c6dc536
commit
75e4c8f0b2
|
@ -53,8 +53,7 @@ def all_by_object_ap_id_q(ap_id) do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Wrong name, returns all.
|
def by_object_ap_id(ap_id) do
|
||||||
def all_non_create_by_object_ap_id_q(ap_id) do
|
|
||||||
from(
|
from(
|
||||||
activity in Activity,
|
activity in Activity,
|
||||||
where:
|
where:
|
||||||
|
|
|
@ -85,7 +85,7 @@ def swap_object_with_tombstone(object) do
|
||||||
|
|
||||||
def delete(%Object{data: %{"id" => id}} = object) do
|
def delete(%Object{data: %{"id" => id}} = object) do
|
||||||
with {:ok, _obj} = swap_object_with_tombstone(object),
|
with {:ok, _obj} = swap_object_with_tombstone(object),
|
||||||
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
|
Repo.delete_all(Activity.by_object_ap_id(id)),
|
||||||
{:ok, true} <- Cachex.del(:object_cache, "object:#{id}") do
|
{:ok, true} <- Cachex.del(:object_cache, "object:#{id}") do
|
||||||
{:ok, object}
|
{:ok, object}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue