Class: UffizziCore::Api::Cli::V1::Accounts::ProjectsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UffizziCore::Api::Cli::V1::Accounts::ProjectsController
- Defined in:
- app/controllers/uffizzi_core/api/cli/v1/accounts/projects_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create a project.
- #index ⇒ Object
Instance Method Details
#create ⇒ Object
Create a project
24 25 26 27 28 29 30 |
# File 'app/controllers/uffizzi_core/api/cli/v1/accounts/projects_controller.rb', line 24 def create project_form = UffizziCore::Api::Cli::V1::Project::CreateForm.new(project_params) project_form.account = resource_account UffizziCore::ProjectService.add_users_to_project!(project_form, project_form.account) if project_form.save respond_with project_form end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/uffizzi_core/api/cli/v1/accounts/projects_controller.rb', line 8 def index projects = resource_account.projects.active respond_with projects, each_serializer: UffizziCore::Api::Cli::V1::ShortProjectSerializer end |