gab-social/app/controllers/api/v1/account_by_username_controller.rb

21 lines
420 B
Ruby
Raw Normal View History

2019-07-02 08:10:25 +01:00
# frozen_string_literal: true
class Api::V1::AccountByUsernameController < Api::BaseController
before_action :set_account
before_action :check_account_suspension
respond_to :json
def show
render json: @account, serializer: REST::AccountSerializer
end
def set_account
2019-11-18 01:54:18 +00:00
@account = Account.find_acct!(params[:username])
2019-07-02 08:10:25 +01:00
end
def check_account_suspension
gone if @account.suspended?
end
end