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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue