mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:27:16 +08:00
FEATURE: add full editing access to queued posts (#5047)
For pending new topics: the body of the post, title, categories and the tags are editable. For pending new replies: only the body is applicable and thus editable DISCUSSION: https://meta.discourse.org/t/66754
This commit is contained in:
@ -20,10 +20,17 @@ class QueuedPostsController < ApplicationController
|
||||
def update
|
||||
qp = QueuedPost.where(id: params[:id]).first
|
||||
|
||||
if params[:queued_post][:raw].present?
|
||||
qp.update_column(:raw, params[:queued_post][:raw])
|
||||
update_params = params[:queued_post]
|
||||
|
||||
qp.raw = update_params[:raw] if update_params[:raw].present?
|
||||
unless qp.topic_id
|
||||
qp.post_options['title'] = update_params[:title] if update_params[:title].present?
|
||||
qp.post_options['category'] = update_params[:category_id].to_i if update_params[:category_id].present?
|
||||
qp.post_options['tags'] = update_params[:tags] if update_params[:tags].present?
|
||||
end
|
||||
|
||||
qp.save(validate: false)
|
||||
|
||||
state = params[:queued_post][:state]
|
||||
begin
|
||||
if state == 'approved'
|
||||
|
Reference in New Issue
Block a user