logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

lists_controller.rb (456B)


  1. # frozen_string_literal: true
  2. class Api::V1::Accounts::ListsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :read }
  4. before_action :require_user!
  5. before_action :set_account
  6. respond_to :json
  7. def index
  8. @lists = @account.lists.where(account: current_account)
  9. render json: @lists, each_serializer: REST::ListSerializer
  10. end
  11. private
  12. def set_account
  13. @account = Account.find(params[:account_id])
  14. end
  15. end