From b9c85c269726faad3c2613b37f01683c8b59f5c6 Mon Sep 17 00:00:00 2001 From: ENT8R Date: Sat, 26 Aug 2023 00:31:18 +0200 Subject: [PATCH] Use where instead of find to prevent 404 --- app/controllers/api/users_controller.rb | 2 +- app/views/api/users/index.xml.builder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb index 9da9d3226..a921b6db7 100644 --- a/app/controllers/api/users_controller.rb +++ b/app/controllers/api/users_controller.rb @@ -19,7 +19,7 @@ module Api raise OSM::APIBadUserInput, "No users were given to search for" if ids.empty? - @users = User.visible.find(ids) + @users = User.visible.where(:id => ids) # Render the result respond_to do |format| diff --git a/app/views/api/users/index.xml.builder b/app/views/api/users/index.xml.builder index 60fcfa898..1b284ef5e 100644 --- a/app/views/api/users/index.xml.builder +++ b/app/views/api/users/index.xml.builder @@ -1,4 +1,4 @@ xml.instruct! :xml, :version => "1.0" xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << render(@users) + osm << (render(@users) || "") end -- 2.39.5