Commit 7e14f86c authored by Greg Messner's avatar Greg Messner

Added description parameter support to Create and Update MR API endpoints (issue-110).

parent d0e73eec
...@@ -8,6 +8,7 @@ v 6.7.0 ...@@ -8,6 +8,7 @@ v 6.7.0
- Show contribution guide link for new issue form (Jeroen van Baarsen) - Show contribution guide link for new issue form (Jeroen van Baarsen)
- Fix CI status for merge requests from fork - Fix CI status for merge requests from fork
- Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard) - Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard)
- Create and Update MR calls now support the description parameter (Greg Messner)
v 6.6.2 v 6.6.2
- Fix 500 error on branch/tag create or remove via UI - Fix 500 error on branch/tag create or remove via UI
......
...@@ -64,6 +64,7 @@ module API ...@@ -64,6 +64,7 @@ module API
# target_project - The target project of the merge request defaults to the :id of the project # target_project - The target project of the merge request defaults to the :id of the project
# assignee_id - Assignee user ID # assignee_id - Assignee user ID
# title (required) - Title of MR # title (required) - Title of MR
# description - Description of MR
# #
# Example: # Example:
# POST /projects/:id/merge_requests # POST /projects/:id/merge_requests
...@@ -72,7 +73,7 @@ module API ...@@ -72,7 +73,7 @@ module API
set_current_user_for_thread do set_current_user_for_thread do
authorize! :write_merge_request, user_project authorize! :write_merge_request, user_project
required_attributes! [:source_branch, :target_branch, :title] required_attributes! [:source_branch, :target_branch, :title]
attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id] attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description]
merge_request = user_project.merge_requests.new(attrs) merge_request = user_project.merge_requests.new(attrs)
merge_request.author = current_user merge_request.author = current_user
merge_request.source_project = user_project merge_request.source_project = user_project
...@@ -105,12 +106,13 @@ module API ...@@ -105,12 +106,13 @@ module API
# assignee_id - Assignee user ID # assignee_id - Assignee user ID
# title - Title of MR # title - Title of MR
# state_event - Status of MR. (close|reopen|merge) # state_event - Status of MR. (close|reopen|merge)
# description - Description of MR
# Example: # Example:
# PUT /projects/:id/merge_request/:merge_request_id # PUT /projects/:id/merge_request/:merge_request_id
# #
put ":id/merge_request/:merge_request_id" do put ":id/merge_request/:merge_request_id" do
set_current_user_for_thread do set_current_user_for_thread do
attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :state_event] attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :state_event, :description]
merge_request = user_project.merge_requests.find(params[:merge_request_id]) merge_request = user_project.merge_requests.find(params[:merge_request_id])
authorize! :modify_merge_request, merge_request authorize! :modify_merge_request, merge_request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment