Add exists to users routes and fix endpoint.
This commit is contained in:
parent
5439bd9f95
commit
568a405ce4
|
@ -86,7 +86,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def exists
|
def exists
|
||||||
render json: { exists: !Namespace.where(name: params[:username]).nil? }
|
render json: { exists: Namespace.where(path: params[:username].downcase).any? }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -33,5 +33,6 @@ scope(path: 'u/:username',
|
||||||
get :projects
|
get :projects
|
||||||
get :contributed, as: :contributed_projects
|
get :contributed, as: :contributed_projects
|
||||||
get :snippets
|
get :snippets
|
||||||
|
get :exists
|
||||||
get '/', to: redirect('/%{username}')
|
get '/', to: redirect('/%{username}')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue