Actually fix remote profile loading
This commit is contained in:
parent
1bfbb53c14
commit
c3f36e9142
|
@ -11,12 +11,11 @@ class Api::V1::AccountByUsernameController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_account
|
def set_account
|
||||||
user = params[:username].split("@")
|
username, domain = params[:username].split("@")
|
||||||
if user[1]
|
if domain
|
||||||
user[1] = "#{user[1]}.#{params[:format]}"
|
@account = Account.find_remote!(username, domain)
|
||||||
@account = Account.find_remote!(user[0], user[1])
|
|
||||||
else
|
else
|
||||||
@account = Account.find_local!(user[0])
|
@account = Account.find_local!(username)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
get '/search', to: 'search#index', as: :search
|
get '/search', to: 'search#index', as: :search
|
||||||
|
|
||||||
get '/account_by_username/:username', to: 'account_by_username#show'
|
get '/account_by_username/:username', to: 'account_by_username#show', username: /(.*)/
|
||||||
|
|
||||||
resources :follows, only: [:create]
|
resources :follows, only: [:create]
|
||||||
resources :media, only: [:create, :update]
|
resources :media, only: [:create, :update]
|
||||||
|
|
Loading…
Reference in New Issue