mirror of
https://git.youjo.love/youjo/youjo-be.git
synced 2024-11-20 13:59:55 +01:00
Delete activity before sending response to client
This commit is contained in:
parent
c2a052a346
commit
fc1f34b851
1 changed files with 6 additions and 8 deletions
|
@ -201,15 +201,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
|
|||
@doc "DELETE /api/v1/statuses/:id"
|
||||
def delete(%{assigns: %{user: user}} = conn, %{id: id}) do
|
||||
with %Activity{} = activity <- Activity.get_by_id_with_object(id),
|
||||
render <-
|
||||
try_render(conn, "show.json",
|
||||
activity: activity,
|
||||
for: user,
|
||||
with_direct_conversation_id: true,
|
||||
with_source: true
|
||||
),
|
||||
{:ok, %Activity{}} <- CommonAPI.delete(id, user) do
|
||||
render
|
||||
try_render(conn, "show.json",
|
||||
activity: activity,
|
||||
for: user,
|
||||
with_direct_conversation_id: true,
|
||||
with_source: true
|
||||
)
|
||||
else
|
||||
_e -> {:error, :not_found}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue