Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
bf2a040c
Commit
bf2a040c
authored
Jan 25, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass validation errors in JSON endpoint
parent
1292c158
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/controllers/groups/variables_controller.rb
app/controllers/groups/variables_controller.rb
+1
-1
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+1
-1
No files found.
app/controllers/groups/variables_controller.rb
View file @
bf2a040c
...
@@ -7,7 +7,7 @@ module Groups
...
@@ -7,7 +7,7 @@ module Groups
format
.
json
do
format
.
json
do
return
head
:ok
if
@group
.
update
(
variables_params
)
return
head
:ok
if
@group
.
update
(
variables_params
)
head
:bad_request
render
status: :bad_request
,
json:
@group
.
errors
.
to_hash
end
end
end
end
end
end
...
...
app/controllers/projects/variables_controller.rb
View file @
bf2a040c
...
@@ -6,7 +6,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -6,7 +6,7 @@ class Projects::VariablesController < Projects::ApplicationController
format
.
json
do
format
.
json
do
return
head
:ok
if
@project
.
update
(
variables_params
)
return
head
:ok
if
@project
.
update
(
variables_params
)
head
:bad_request
render
status: :bad_request
,
json:
@project
.
errors
.
to_hash
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment