Commit 12a1290e by wajeeha-khalid

u

parent 79e68dcb
...@@ -59,19 +59,7 @@ put "#{APIPREFIX}/threads/:thread_id" do |thread_id| ...@@ -59,19 +59,7 @@ put "#{APIPREFIX}/threads/:thread_id" do |thread_id|
if thread.errors.any? if thread.errors.any?
error 400, thread.errors.full_messages.to_json error 400, thread.errors.full_messages.to_json
else 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 presenter.to_hash.to_json
end end
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