diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-13 17:15:09 -0500 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-13 17:15:09 -0500 |
| commit | ecee057795ff22c335cb999bb677fbc623e879df (patch) | |
| tree | d99398c3e8574848308641a9b21e5a3305208ae9 /lib/api/issues.rb | |
| parent | 6d19e13df62376916e024ff44939bf2a8f5b671b (diff) | |
| parent | d7a28f3c12950d56a187148fda9dce39a9f2bf08 (diff) | |
| download | gitlab-ce-ecee057795ff22c335cb999bb677fbc623e879df.tar.gz | |
Merge remote-tracking branch 'origin/master' into with-pipeline-view
Diffstat (limited to 'lib/api/issues.rb')
| -rw-r--r-- | lib/api/issues.rb | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 40928749481..f59a4d6c012 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -103,8 +103,7 @@ module API # Example Request: # GET /projects/:id/issues/:issue_id get ":id/issues/:issue_id" do - @issue = user_project.issues.find(params[:issue_id]) - not_found! unless can?(current_user, :read_issue, @issue) + @issue = find_project_issue(params[:issue_id]) present @issue, with: Entities::Issue, current_user: current_user end @@ -234,42 +233,6 @@ module API authorize!(:destroy_issue, issue) issue.destroy end - - # Subscribes to a project issue - # - # Parameters: - # id (required) - The ID of a project - # issue_id (required) - The ID of a project issue - # Example Request: - # POST /projects/:id/issues/:issue_id/subscription - post ':id/issues/:issue_id/subscription' do - issue = user_project.issues.find(params[:issue_id]) - - if issue.subscribed?(current_user) - not_modified! - else - issue.toggle_subscription(current_user) - present issue, with: Entities::Issue, current_user: current_user - end - end - - # Unsubscribes from a project issue - # - # Parameters: - # id (required) - The ID of a project - # issue_id (required) - The ID of a project issue - # Example Request: - # DELETE /projects/:id/issues/:issue_id/subscription - delete ':id/issues/:issue_id/subscription' do - issue = user_project.issues.find(params[:issue_id]) - - if issue.subscribed?(current_user) - issue.unsubscribe(current_user) - present issue, with: Entities::Issue, current_user: current_user - else - not_modified! - end - end end end end |
