mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 17:02:26 +08:00
FIX: move topic links and quoted posts extraction to the PostRevisor
This commit is contained in:
parent
5a09482b0f
commit
23a5c6444a
@ -149,10 +149,7 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
revisor = PostRevisor.new(post)
|
revisor = PostRevisor.new(post)
|
||||||
if revisor.revise!(current_user, changes, opts)
|
revisor.revise!(current_user, changes, opts)
|
||||||
TopicLink.extract_from(post)
|
|
||||||
QuotedPost.extract_from(post)
|
|
||||||
end
|
|
||||||
|
|
||||||
return render_json_error(post) if post.errors.present?
|
return render_json_error(post) if post.errors.present?
|
||||||
return render_json_error(post.topic) if post.topic.errors.present?
|
return render_json_error(post.topic) if post.topic.errors.present?
|
||||||
|
@ -136,6 +136,9 @@ class PostRevisor
|
|||||||
publish_changes
|
publish_changes
|
||||||
grant_badge
|
grant_badge
|
||||||
|
|
||||||
|
TopicLink.extract_from(@post)
|
||||||
|
QuotedPost.extract_from(@post)
|
||||||
|
|
||||||
successfully_saved_post_and_topic
|
successfully_saved_post_and_topic
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user