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:
authorValery Sizov <valery@gitlab.com>2017-08-14 13:54:27 +0300
committerValery Sizov <valery@gitlab.com>2017-08-14 13:55:02 +0300
commit2a483d4fd8ce493fd0ffca0a8c8214b48b6bfa86 (patch)
tree229d62cd2b7534b63c7aa00c48b4ea16fbdc7c39
parent21a6898b10ed75f6260e72467b9e1f839d48456c (diff)
Create endpoint load discussion diff[ci skip]
-rw-r--r--app/controllers/projects/discussions_controller.rb6
-rw-r--r--config/routes/project.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/projects/discussions_controller.rb b/app/controllers/projects/discussions_controller.rb
index 2e6ab7903b8..498d78ff587 100644
--- a/app/controllers/projects/discussions_controller.rb
+++ b/app/controllers/projects/discussions_controller.rb
@@ -21,6 +21,12 @@ class Projects::DiscussionsController < Projects::ApplicationController
}
end
+ def show
+ render json: {
+ discussion_html: view_to_html_string('discussions/_diff_with_notes', discussion: discussion)
+ }
+ end
+
private
def merge_request
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 06928c7b9ce..049cb9775ae 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -123,7 +123,7 @@ constraints(ProjectUrlConstrainer.new) do
post :bulk_update
end
- resources :discussions, only: [], constraints: { id: /\h{40}/ } do
+ resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do
member do
post :resolve
delete :resolve, action: :unresolve