include dry monads

This commit is contained in:
2023-01-31 19:32:40 +11:00
parent d6608cdf12
commit 89f3d5387a
3 changed files with 5 additions and 12 deletions

View File

@@ -2,11 +2,10 @@ module Adamantium
module Actions
module Media
class Create < Action
include Deps["commands.media.upload", "logger"]
include Deps["commands.media.upload"]
before :authenticate!
def handle(req, res)
logger.info("I am CREATE")
data = req.params[:file]
halt 401 unless verify_scope(req: req, scope: :media)
@@ -17,7 +16,6 @@ module Adamantium
end
m.success do |v|
logger.info("I have CREATED")
res.status = 201
res.headers["Location"] = v
res.body = {

View File

@@ -2,11 +2,9 @@ module Adamantium
module Actions
module Media
class Show < Action
include Deps["settings", "logger"]
include Deps["settings"]
def handle(req, res)
logger.info("I am SHOW")
res.body = if req.params[:q] == "source"
{
items: media_url(req.params[:file])