Skip to content
Snippets Groups Projects
Commit 15e7d89c authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Returning 404 for inexistent users and collections

parent af48eddf
No related branches found
No related tags found
No related merge requests found
...@@ -114,7 +114,11 @@ class V1::CollectionsController < ApplicationController ...@@ -114,7 +114,11 @@ class V1::CollectionsController < ApplicationController
def stageable; set_collection; end def stageable; set_collection; end
def set_collection def set_collection
@collection ||= Collection.find(params[:id]) @collection ||= Collection.where(id: params[:id]).first
render status: :not_found if @collection.blank?
@collection
end end
def set_new_collection def set_new_collection
......
...@@ -210,7 +210,11 @@ class V1::UsersController < ApplicationController ...@@ -210,7 +210,11 @@ class V1::UsersController < ApplicationController
def set_user def set_user
users = paginate policy_scope(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 end
def set_new_user def set_new_user
......
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