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
end
def exists
render json: { exists: !Namespace.where(name: params[:username]).nil? }
render json: { exists: Namespace.where(path: params[:username].downcase).any? }
end
private
......
......@@ -33,5 +33,6 @@ scope(path: 'u/:username',
get :projects
get :contributed, as: :contributed_projects
get :snippets
get :exists
get '/', to: redirect('/%{username}')
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