Skip to content
Snippets Groups Projects
Unverified Commit 54f34d3f authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Return HTTP 410 for suspended accounts in GET /api/v1/accounts/:id (#7287)

Fix #7243
parent da61352f
No related branches found
No related tags found
1 merge request!8WIP: Backport from Mastodon FE main to support the "Direct messages" column and Lists
......@@ -5,6 +5,7 @@ class Api::V1::AccountsController < Api::BaseController
before_action -> { doorkeeper_authorize! :follow }, only: [:follow, :unfollow, :block, :unblock, :mute, :unmute]
before_action :require_user!, except: [:show]
before_action :set_account
before_action :check_account_suspension, only: [:show]
respond_to :json
......@@ -54,4 +55,8 @@ class Api::V1::AccountsController < Api::BaseController
def relationships(**options)
AccountRelationshipsPresenter.new([@account.id], current_user.account_id, options)
end
def check_account_suspension
gone if @account.suspended?
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment