DEV: API for plugins to add post update params and handlers (#12505)

This commit is contained in:
Mark VanLandingham
2021-03-24 10:22:16 -05:00
committed by GitHub
parent e7fb45cc29
commit 371afc45e0
5 changed files with 47 additions and 1 deletions

View File

@ -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)