Commit 568a405c authored by Bryce Johnson's avatar Bryce Johnson

Add exists to users routes and fix endpoint.

parent 5439bd9f
...@@ -86,7 +86,7 @@ class UsersController < ApplicationController ...@@ -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', ...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment