summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-29 18:54:16 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 18:58:19 +0100
commita8887a0d9c4a41a0707b92189572aeff10566af6 (patch)
tree6c7fb9025c2f1ffc7ae82ecaeffd0facd21c042d /app
parent0bfcdd66bf932c080398ff264323b5c0df17d05c (diff)
downloadgitlab-ce-a8887a0d9c4a41a0707b92189572aeff10566af6.tar.gz
Use `resource` in Group Variables routing scheme
Diffstat (limited to 'app')
-rw-r--r--app/controllers/groups/variables_controller.rb13
-rw-r--r--app/presenters/ci/group_variable_presenter.rb4
2 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb
index 2f7058e95ea..c0eff63da18 100644
--- a/app/controllers/groups/variables_controller.rb
+++ b/app/controllers/groups/variables_controller.rb
@@ -2,7 +2,18 @@ module Groups
class VariablesController < Groups::ApplicationController
before_action :authorize_admin_build!
- def save_multiple
+ def show
+ respond_to do |format|
+ format.json do
+ variables = @group.variables
+ .map { |variable| variable.present(current_user: current_user) }
+
+ render status: :ok, json: { variables: variables }
+ end
+ end
+ end
+
+ def update
respond_to do |format|
format.json do
return head :ok if @group.update(variables_params)
diff --git a/app/presenters/ci/group_variable_presenter.rb b/app/presenters/ci/group_variable_presenter.rb
index fb6dfcc1e4d..98d68bc7a83 100644
--- a/app/presenters/ci/group_variable_presenter.rb
+++ b/app/presenters/ci/group_variable_presenter.rb
@@ -11,11 +11,11 @@ module Ci
end
def edit_path
- group_variables_save_multiple_path(group)
+ group_variables_path(group)
end
def delete_path
- group_variables_save_multiple_path(group)
+ group_variables_path(group)
end
end
end