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

Add `GET /api/v1/accounts/lookup` REST API (#15740)

parent 3f852313
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class Api::V1::Accounts::LookupController < Api::BaseController
before_action -> { authorize_if_got_token! :read, :'read:accounts' }
before_action :set_account
def show
render json: @account, serializer: REST::AccountSerializer
end
private
def set_account
@account = ResolveAccountService.new.call(params[:acct], skip_webfinger: true) || raise(ActiveRecord::RecordNotFound)
end
end
......@@ -431,6 +431,7 @@ Rails.application.routes.draw do
get :verify_credentials, to: 'credentials#show'
patch :update_credentials, to: 'credentials#update'
resource :search, only: :show, controller: :search
resource :lookup, only: :show, controller: :lookup
resources :relationships, only: :index
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