mastodon/app/controllers/api/accounts/lookup_controller.rb

15 lines
305 B
Ruby
Raw Normal View History

2016-03-21 16:33:04 +00:00
class Api::Accounts::LookupController < ApiController
before_action :doorkeeper_authorize!
respond_to :json
def index
@accounts = Account.where(domain: nil).where(username: lookup_params)
end
private
def lookup_params
(params[:usernames] || '').split(',').map(&:strip)
end
end