mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Support for choosing a destination category when splitting topics.
This commit is contained in:
@@ -227,6 +227,8 @@ class TopicsController < ApplicationController
|
||||
|
||||
def move_posts
|
||||
params.require(:post_ids)
|
||||
params.require(:topic_id)
|
||||
params.permit(:category_id)
|
||||
|
||||
topic = Topic.where(id: params[:topic_id]).first
|
||||
guardian.ensure_can_move_posts!(topic)
|
||||
@@ -325,6 +327,7 @@ class TopicsController < ApplicationController
|
||||
args = {}
|
||||
args[:title] = params[:title] if params[:title].present?
|
||||
args[:destination_topic_id] = params[:destination_topic_id].to_i if params[:destination_topic_id].present?
|
||||
args[:category_id] = params[:category_id].to_i if params[:category_id].present?
|
||||
|
||||
topic.move_posts(current_user, post_ids_including_replies, args)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user