-
-
Save bilby91/90ed146497d8a63edf69f1699004e6ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Api::Controllers::Lists | |
class Create | |
include Api::Action | |
include JSONAPI::Hanami::Action | |
deserializable_resource :list | |
params do | |
required(:list).schema do | |
required(:name) | |
end | |
end | |
def call(params) | |
self.data = list_repository.create(params[:list]) | |
self.status = 200 | |
end | |
def list_repository | |
@list_repository ||= ListRepository.new | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment