diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-03 16:29:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-10-06 13:00:01 +0300 |
commit | 4d9f76c15115d3fd48d61e998edca86917fb1ccf (patch) | |
tree | 1bd8bce6f935c1b5785d8dab310ef900c028a0e8 /app/controllers | |
parent | 4241c2906c9531ab7ddb43740b222a102f5508fa (diff) |
Added ability to save the new issue
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/boards/issues_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/projects/boards/issues_controller.rb b/app/controllers/projects/boards/issues_controller.rb index 4aa7982eab4..41794193784 100644 --- a/app/controllers/projects/boards/issues_controller.rb +++ b/app/controllers/projects/boards/issues_controller.rb @@ -19,6 +19,15 @@ module Projects } end + def create + list = project.board.lists.find(params[:list_id]) + + issue = Issues::CreateService.new(project, current_user, issue_params.merge(request: request)).execute + issue.labels << list.label + + render json: issue.to_json + end + def update service = ::Boards::Issues::MoveService.new(project, current_user, move_params) @@ -54,6 +63,10 @@ module Projects def move_params params.permit(:id, :from_list_id, :to_list_id) end + + def issue_params + params.require(:issue).permit(:title) + end end end end |