Add trips
This commit is contained in:
16
slices/admin/actions/trips/add_post.rb
Normal file
16
slices/admin/actions/trips/add_post.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Trips
|
||||
class AddPost < Admin::Action
|
||||
|
||||
include Deps["commands.trips.add_post"]
|
||||
|
||||
def handle(req, res)
|
||||
add_post.call(post_id: req.params[:post_id], trip_id: req.params[:trip_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
16
slices/admin/actions/trips/create.rb
Normal file
16
slices/admin/actions/trips/create.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Trips
|
||||
class Create < Admin::Action
|
||||
|
||||
include Deps["commands.trips.create"]
|
||||
|
||||
def handle(req, res)
|
||||
create.call(trip: req.params[:trip])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
12
slices/admin/actions/trips/index.rb
Normal file
12
slices/admin/actions/trips/index.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Trips
|
||||
class Index < Admin::Action
|
||||
def handle(req, res)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
12
slices/admin/actions/trips/new.rb
Normal file
12
slices/admin/actions/trips/new.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Trips
|
||||
class New < Admin::Action
|
||||
def handle(req, res)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
16
slices/admin/actions/trips/show.rb
Normal file
16
slices/admin/actions/trips/show.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Trips
|
||||
class Show < Admin::Action
|
||||
|
||||
include Deps["views.trips.show"]
|
||||
|
||||
def handle(req, res)
|
||||
res.render show, id: req.params[:id]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user