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