diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api/accounts/lookup_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/api/accounts/lookup_controller.rb b/app/controllers/api/accounts/lookup_controller.rb new file mode 100644 index 000000000..dc8bcb132 --- /dev/null +++ b/app/controllers/api/accounts/lookup_controller.rb @@ -0,0 +1,11 @@ +class Api::Accounts::LookupController < ApplicationController + def index + @accounts = Account.where(domain: nil).where(username: lookup_params) + end + + private + + def lookup_params + (params[:usernames] || '').split(',').map(&:strip) + end +end |