Remove unnecessary single object selection
parent
4cefb8d06e
commit
3f9b2dadc8
|
@ -51,8 +51,6 @@ module UserServlet
|
|||
tmp_params = sanitize_params(params)
|
||||
opts[:id] = tmp_params[:id] if tmp_params[:id]
|
||||
data = get_db.update_user(opts)
|
||||
# Only return the single object if the id parameter is present
|
||||
data = data.first if !sanitized_params[:id].nil? && data.count == 1
|
||||
set_json_data_response(response: data)
|
||||
rescue => e
|
||||
print_error_and_create_response(error: e, message: 'There was an error updating the user:', code: 500)
|
||||
|
|
Loading…
Reference in New Issue