topic-status-info component wasn't updated when topic is closed/opened.

This commit is contained in:
Guo Xiang Tan
2017-03-31 15:56:09 +08:00
parent 2fd1c49b88
commit 0bbad5040a
5 changed files with 30 additions and 15 deletions

View File

@ -273,7 +273,12 @@ class TopicsController < ApplicationController
@topic = Topic.find_by(id: topic_id)
guardian.ensure_can_moderate!(@topic)
@topic.update_status(status, enabled, current_user, until: params[:until])
render nothing: true
render json: success_json.merge!(
topic_status_update: TopicStatusUpdateSerializer.new(
TopicStatusUpdate.find_by(topic: @topic), root: false
)
)
end
def mute