object: return the deleted object as well
This commit is contained in:
parent
68a1405643
commit
10f3958468
|
@ -57,7 +57,7 @@ def delete(%Object{data: %{"id" => id}} = object) do
|
||||||
with Repo.delete(object),
|
with Repo.delete(object),
|
||||||
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
|
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
|
||||||
{:ok, true} <- Cachex.del(:user_cache, "object:#{id}") do
|
{:ok, true} <- Cachex.del(:user_cache, "object:#{id}") do
|
||||||
:ok
|
{:ok, object}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -273,7 +273,7 @@ def delete(%Object{data: %{"id" => id, "actor" => actor}} = object, local \\ tru
|
||||||
"to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
|
"to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
|
||||||
}
|
}
|
||||||
|
|
||||||
with Object.delete(object),
|
with {:ok, _} <- Object.delete(object),
|
||||||
{:ok, activity} <- insert(data, local),
|
{:ok, activity} <- insert(data, local),
|
||||||
:ok <- maybe_federate(activity),
|
:ok <- maybe_federate(activity),
|
||||||
{:ok, _actor} <- User.decrease_note_count(user) do
|
{:ok, _actor} <- User.decrease_note_count(user) do
|
||||||
|
|
Loading…
Reference in New Issue