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