Merge pull request #63 from jedmund/fix-users-response

Fix response when requesting nonexistent user
This commit is contained in:
Justin Edmund 2023-01-28 20:51:08 -08:00 committed by GitHub
commit 1474580d37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)