mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:17:57 +08:00
DEV: API for plugins to add post update params and handlers (#12505)
This commit is contained in:

committed by
GitHub

parent
e7fb45cc29
commit
371afc45e0
@ -208,6 +208,10 @@ class PostsController < ApplicationController
|
||||
edit_reason: params[:post][:edit_reason]
|
||||
}
|
||||
|
||||
Post.plugin_permitted_update_params.keys.each do |param|
|
||||
changes[param] = params[:post][param]
|
||||
end
|
||||
|
||||
raw_old = params[:post][:raw_old]
|
||||
if raw_old.present? && raw_old != post.raw
|
||||
return render_json_error(I18n.t('edit_conflict'), status: 409)
|
||||
|
Reference in New Issue
Block a user