mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Merge pull request #2938 from riking/include_raw
Add ?include_raw parameter to topic views
This commit is contained in:
commit
8432acf0af
2 changed files with 2 additions and 1 deletions
|
@ -441,7 +441,7 @@ class TopicsController < ApplicationController
|
|||
end
|
||||
|
||||
def perform_show_response
|
||||
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false)
|
||||
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false, include_raw: !!params[:include_raw])
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
|
|
|
@ -21,6 +21,7 @@ module PostStreamSerializerMixin
|
|||
object.posts.each_with_index do |p, idx|
|
||||
highest_number_in_posts = p.post_number if p.post_number > highest_number_in_posts
|
||||
ps = PostSerializer.new(p, scope: scope, root: false)
|
||||
ps.add_raw = true if @options[:include_raw]
|
||||
ps.topic_view = object
|
||||
p.topic = object.topic
|
||||
|
||||
|
|
Loading…
Reference in a new issue