Class: UffizziCore::Api::Cli::V1::Accounts::ProjectsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/uffizzi_core/api/cli/v1/accounts/projects_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

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. = 
  UffizziCore::ProjectService.add_users_to_project!(project_form, project_form.) if project_form.save

  respond_with project_form
end

#indexObject



8
9
10
11
12
# File 'app/controllers/uffizzi_core/api/cli/v1/accounts/projects_controller.rb', line 8

def index
  projects = .projects.active

  respond_with projects, each_serializer: UffizziCore::Api::Cli::V1::ShortProjectSerializer
end