mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Minor tweaks to importing first posts
This commit is contained in:
parent
558a06a117
commit
d1e7fa1c47
4 changed files with 38 additions and 10 deletions
|
@ -147,8 +147,9 @@ class PostsController < ApplicationController
|
|||
post = find_post_from_params
|
||||
content = Rails.cache.fetch("embed-topic:#{post.topic_id}", expires_in: 10.minutes) do
|
||||
url = TopicEmbed.where(topic_id: post.topic_id).pluck(:embed_url).first
|
||||
doc = TopicEmbed.find_remote(url)
|
||||
doc.content
|
||||
title, body = TopicEmbed.find_remote(url)
|
||||
body << TopicEmbed.imported_from_html(url)
|
||||
body
|
||||
end
|
||||
render json: {cooked: content}
|
||||
rescue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue