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
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2015-11-22 00:34:53 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2015-11-22 00:34:53 +0300
commit04a3d27eaba0312d99e8d88a3a9ee4b5c83ecce1 (patch)
tree76edf025912fa34c1942f98deefb406148953842 /lib/api/tags.rb
parent3ea05c5b5b253de33d8bf8d615c66e2935b940ef (diff)
Allow editing a release in API via PUT method
Diffstat (limited to 'lib/api/tags.rb')
-rw-r--r--lib/api/tags.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index e46d9bb96f0..47621f443e6 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -60,6 +60,27 @@ module API
render_api_error!(result[:message], result[:http_status])
end
end
+
+ # Updates a release notes of a tag
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # tag_name (required) - The name of the tag
+ # description (required) - Release notes with markdown support
+ # Example Request:
+ # 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]
+ result = UpdateReleaseService.new(user_project, current_user).
+ execute(params[:tag_name], params[:description])
+
+ if result[:status] == :success
+ present result[:release], with: Entities::Release
+ else
+ render_api_error!(result[:message], result[:http_status])
+ end
+ end
end
end
end