Add ?include_raw parameter to topic views
This commit is contained in:
parent
9d43e0ae0c
commit
6a946712b3
|
@ -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 New Issue