Handle results in action handle methods
This commit is contained in:
@@ -3,11 +3,17 @@
|
|||||||
|
|
||||||
require "hanami/action"
|
require "hanami/action"
|
||||||
require "httparty"
|
require "httparty"
|
||||||
|
require "dry-monads"
|
||||||
|
require "dry-matcher"
|
||||||
|
require "dry/matcher/result_matcher"
|
||||||
|
|
||||||
module Adamantium
|
module Adamantium
|
||||||
class Action < Hanami::Action
|
class Action < Hanami::Action
|
||||||
include Deps["logger", "settings", not_found_view: "views.not_found"]
|
include Deps["logger", "settings", not_found_view: "views.not_found"]
|
||||||
|
|
||||||
|
include Dry::Matcher.for(:handle, with: Dry::Matcher::ResultMatcher)
|
||||||
|
include Dry::Monads[:result]
|
||||||
|
|
||||||
handle_exception ROM::TupleCountMismatchError => :not_found
|
handle_exception ROM::TupleCountMismatchError => :not_found
|
||||||
|
|
||||||
def authenticate!(req, res)
|
def authenticate!(req, res)
|
||||||
|
Reference in New Issue
Block a user