Commit 79e68dcb by wajeeha-khalid

MA-2663: Donot mark thread unread on any action but creation

parent bb116a19
......@@ -59,7 +59,19 @@ put "#{APIPREFIX}/threads/:thread_id" do |thread_id|
if thread.errors.any?
error 400, thread.errors.full_messages.to_json
else
presenter = ThreadPresenter.factory(thread, nil)
presenter = ThreadPresenter.factory(thread, nil)
# Temporary check for user_id in params to make sure web app does not crash if user_id is not
# passed on update.
# TODO: Remove this check once web call is updated to pass 'user_id' too for TNL-4995.
# For reference; see discussion at MA-2139.
if params[:user_id]
# Mark thread as read for requesting user on update
user.mark_as_read(thread)
presenter = ThreadPresenter.factory(thread, user)
else
presenter = ThreadPresenter.factory(thread, nil)
end
presenter.to_hash.to_json
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment