Fix media URL inconsistency when deleting statuses via API (#35880)

This commit is contained in:
Dima
2025-10-29 16:46:16 +00:00
committed by GitHub
parent e7cd5a430e
commit ebf5cee38e

View File

@@ -126,10 +126,11 @@ class Api::V1::StatusesController < Api::BaseController
@status = Status.where(account: current_account).find(params[:id])
authorize @status, :destroy?
json = render_to_body json: @status, serializer: REST::StatusSerializer, source_requested: true
@status.discard_with_reblogs
StatusPin.find_by(status: @status)&.destroy
@status.account.statuses_count = @status.account.statuses_count - 1
json = render_to_body json: @status, serializer: REST::StatusSerializer, source_requested: true
RemovalWorker.perform_async(@status.id, { 'redraft' => !truthy_param?(:delete_media) })