Add Summary to trips
This commit is contained in:
@@ -3,13 +3,20 @@ module Admin
|
||||
module Trips
|
||||
class Update
|
||||
include Dry::Monads[:result]
|
||||
include Deps["repos.trip_repo"]
|
||||
include Deps["repos.trip_repo", renderer: "renderers.markdown"]
|
||||
|
||||
def call(id:, trip:)
|
||||
trip_repo.update(id, trip)
|
||||
trip_repo.update(id, prepare(trip: trip))
|
||||
|
||||
Success()
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def prepare(trip:)
|
||||
trip[:summary] = renderer.call(content: trip[:summary])
|
||||
trip
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user