Class: RazorRisk::Cassini::Applications::RouteVerbAdaptors::Capabilities::UpdateGroupPost

Inherits:
RESTFramework::VerbHandler
  • Object
show all
Includes:
Pantheios, GetHandlerMixin, RazorRisk::Core::Diagnostics::Logger
Defined in:
lib/razor_risk/cassini/applications/route_verb_adaptors/capabilities/update_group_subject.rb

Overview

########################################################################## AddUser

Constant Summary collapse

HTTP_VERB =
:post
HTTP_CONTENT_TYPES =
%w{ application/xml text/xml }
HTTP_ACCEPTS =
%w{ application/xml application/json text/xml }
ROUTE_VARIABLES =
%w[
  group_id
]

Constants included from GetHandlerMixin

GetHandlerMixin::ErrorHeaders, GetHandlerMixin::QUERY_PARAMETERS

Instance Method Summary collapse

Instance Method Details

#handle(env, params, request, response) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/razor_risk/cassini/applications/route_verb_adaptors/capabilities/update_group_subject.rb', line 46

def handle(env, params, request, response)

  trace ParamNames[:env, :params, :request, :response], env, params, request, response

  request.body.rewind

  body_text   =   request.body.read
  # rq_body     =   nil

  # case request.content_type
  # when 'application/xml', 'text/xml'
  #   rq_body =   ::Nokogiri.XML body_text
  # else
  #   log :violation, "unexpected content-type '#{request.content_type}'"
  # end
  group_id = params['group_id']

  super do |ec|
     ec.update_group_subjects group_id,body_text, indicate_result_by: :qualified_result
  end
end