Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
15e7d89c
Commit
15e7d89c
authored
4 years ago
by
Israel Barreto Sant'Anna
Browse files
Options
Downloads
Patches
Plain Diff
Returning 404 for inexistent users and collections
parent
af48eddf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/v1/collections_controller.rb
+5
-1
5 additions, 1 deletion
app/controllers/v1/collections_controller.rb
app/controllers/v1/users_controller.rb
+5
-1
5 additions, 1 deletion
app/controllers/v1/users_controller.rb
with
10 additions
and
2 deletions
app/controllers/v1/collections_controller.rb
+
5
−
1
View file @
15e7d89c
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
app/controllers/v1/users_controller.rb
+
5
−
1
View file @
15e7d89c
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment