Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2015-11-21 19:29:26 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2015-11-21 19:29:26 +0300
commit2cba93a0d2d12ee36bf98569e5c6c14ac7ea40e0 (patch)
tree2d98ebaa9c4640d0e16b1dcd3e1339e6dbb0a0dd /lib
parent4427e80fb5a8b42b1de04f8346bf0dd431e7dd86 (diff)
Make tag API consistent for release feature
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb3
-rw-r--r--lib/api/tags.rb8
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3da6bc415d6..5dea74db295 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -322,7 +322,8 @@ module API
end
class Release < Grape::Entity
- expose :tag, :description
+ expose :tag, as: :tag_name
+ expose :description
end
class RepoTag < Grape::Entity
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index 673342dd447..2c6c73da08e 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -44,14 +44,14 @@ module API
#
# Parameters:
# id (required) - The ID of a project
- # tag (required) - The name of the tag
+ # tag_name (required) - The name of the tag
# description (required) - Release notes with markdown support
# Example Request:
- # PUT /projects/:id/repository/tags
- put ':id/repository/:tag/release', requirements: { tag: /.*/ } do
+ # PUT /projects/:id/repository/tags/:tag_name/release
+ put ':id/repository/tags/:tag_name/release', requirements: { tag_name: /.*/ } do
authorize_push_project
required_attributes! [:description]
- release = user_project.releases.find_or_initialize_by(tag: params[:tag])
+ release = user_project.releases.find_or_initialize_by(tag: params[:tag_name])
release.update_attributes(description: params[:description])
present release, with: Entities::Release