Class: SocMed::ReportsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SocMed::ReportsController
- Defined in:
- app/controllers/soc_med/reports_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/soc_med/reports_controller.rb', line 8 def create report_service::Create.call(params) do |success, failure| success.call { |object| success_response(report: serialized_resource(object, ::Reports::OverviewBlueprint)) } failure.call(&method(:error_response)) end end |
#destroy ⇒ Object
15 16 17 18 19 20 |
# File 'app/controllers/soc_med/reports_controller.rb', line 15 def destroy report_service::Destroy.call(params) do |success, failure| success.call { success_response(report: { destroyed: true }) } failure.call(&method(:error_response)) end end |