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

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

Instance Method Summary collapse

Instance Method Details

#destroyObject

Delete a project



42
43
44
45
46
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 42

def destroy
  resource_project.disable!

  head :no_content
end

#indexObject

Get projects of current user



17
18
19
20
21
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 17

def index
  projects = current_user.projects.active.order(updated_at: :desc)

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

#showObject

Get a project by slug



30
31
32
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 30

def show
  respond_with resource_project
end