diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-30 00:44:53 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 18:58:19 +0100 |
commit | b48d8c8ad0bb2874db6b4c9accb3bebd19e9f2c8 (patch) | |
tree | b3639bb715f458a6023e7f4556cb3ffcb4167aa8 /app/controllers/groups | |
parent | 9eb3bb5cffbd18a744be2553ab2be7cb7843b029 (diff) | |
download | gitlab-ce-b48d8c8ad0bb2874db6b4c9accb3bebd19e9f2c8.tar.gz |
Return all variables after UPDATE
Diffstat (limited to 'app/controllers/groups')
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index c0eff63da18..afa98aa8267 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -16,7 +16,12 @@ module Groups def update respond_to do |format| format.json do - return head :ok if @group.update(variables_params) + if @group.update(variables_params) + variables = @group.variables + .map { |variable| variable.present(current_user: current_user) } + + return render status: :ok, json: { variables: variables } + end render status: :bad_request, json: @group.errors.full_messages end |