Merge pull request #63 from jedmund/fix-users-response
Fix response when requesting nonexistent user
This commit is contained in:
commit
1474580d37
1 changed files with 25 additions and 22 deletions
|
|
@ -40,7 +40,9 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render_not_found_response('user') unless @user
|
if @user.nil?
|
||||||
|
render_not_found_response('user')
|
||||||
|
else
|
||||||
|
|
||||||
conditions = build_conditions(request.params)
|
conditions = build_conditions(request.params)
|
||||||
conditions[:user_id] = @user.id
|
conditions[:user_id] = @user.id
|
||||||
|
|
@ -65,6 +67,7 @@ module Api
|
||||||
per_page: COLLECTION_PER_PAGE
|
per_page: COLLECTION_PER_PAGE
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def check_email
|
def check_email
|
||||||
render json: EmptyBlueprint.render_as_json(nil, email: params[:email], availability: true)
|
render json: EmptyBlueprint.render_as_json(nil, email: params[:email], availability: true)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue