Skip to content
Snippets Groups Projects
Commit c995392d authored by Treadway, Ross T (UG - Computer Science)'s avatar Treadway, Ross T (UG - Computer Science)
Browse files

Fixing bug that would cause single ids to be bounced

parent 45b805d3
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,13 @@ class AuthController < ApplicationController ...@@ -16,9 +16,13 @@ class AuthController < ApplicationController
def get_email def get_email
ids = params["auth"]["ids"] ids = params["auth"]["ids"]
emails = [] emails = []
ids.each do |i| if ids.kind_of?(Array)
emails.push(User.find_by(id: i).email) ids.each do |i|
emails.push(User.find_by(id: i).email)
end
else
emails.push(User.find_by(id: ids).email)
end
render json: { emails: emails }, status: 200 render json: { emails: emails }, status: 200
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment