diff --git a/app/controllers/v1/collections_controller.rb b/app/controllers/v1/collections_controller.rb index 451b560667a25989d9d316293a807445ae1bc963..079b23d8fabf1c53e224cf72a7c1155264d81c2e 100644 --- a/app/controllers/v1/collections_controller.rb +++ b/app/controllers/v1/collections_controller.rb @@ -114,7 +114,11 @@ class V1::CollectionsController < ApplicationController def stageable; set_collection; end def set_collection - @collection ||= Collection.find(params[:id]) + @collection ||= Collection.where(id: params[:id]).first + + render status: :not_found if @collection.blank? + + @collection end def set_new_collection diff --git a/app/controllers/v1/users_controller.rb b/app/controllers/v1/users_controller.rb index ad71f99d715dff1f2278b40e99ace9cdc7011cb8..f7695f95821e04e00fcdd177ef5c586a2f9937ba 100644 --- a/app/controllers/v1/users_controller.rb +++ b/app/controllers/v1/users_controller.rb @@ -210,7 +210,11 @@ class V1::UsersController < ApplicationController def set_user users = paginate policy_scope(User) - @user = users.find(params[:id]) + @user = users.where(id: params[:id]).first + + render status: :not_found if @user.blank? + + @user end def set_new_user