2019-05-12 22:37:49 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-07-13 15:36:16 -04:00
|
|
|
class DiscourseChatIntegration::PublicController < ApplicationController
|
|
|
|
requires_plugin DiscourseChatIntegration::PLUGIN_NAME
|
2017-07-24 11:13:53 -04:00
|
|
|
|
|
|
|
def post_transcript
|
|
|
|
params.require(:secret)
|
|
|
|
|
2017-10-03 05:42:07 -04:00
|
|
|
redis_key = "chat_integration:transcript:#{params[:secret]}"
|
2019-12-03 04:45:32 -05:00
|
|
|
content = Discourse.redis.get(redis_key)
|
2017-07-24 11:13:53 -04:00
|
|
|
|
|
|
|
if content
|
2017-08-01 15:53:39 -04:00
|
|
|
render json: { content: content }
|
2017-10-03 05:42:07 -04:00
|
|
|
else
|
|
|
|
raise Discourse::NotFound
|
2017-07-24 11:13:53 -04:00
|
|
|
end
|
|
|
|
end
|
2017-08-01 15:53:39 -04:00
|
|
|
end
|