diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2015-11-22 00:34:53 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2015-11-22 00:34:53 +0300 |
commit | 04a3d27eaba0312d99e8d88a3a9ee4b5c83ecce1 (patch) | |
tree | 76edf025912fa34c1942f98deefb406148953842 /lib | |
parent | 3ea05c5b5b253de33d8bf8d615c66e2935b940ef (diff) |
Allow editing a release in API via PUT method
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/tags.rb | 21 |
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 |