Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-05 22:24:29 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-11 17:39:05 +0300
commitecf4c10e9c395604583820ad01167db34d09d4aa (patch)
tree7734ebceb1167832606dcc5463caacc9d0bb4460 /app/controllers/projects/boards_controller.rb
parentb4b8e0ec9405c4b5d17b53552612397e847e734d (diff)
Add index action to Projects::BoardsController to return project boards
Diffstat (limited to 'app/controllers/projects/boards_controller.rb')
-rw-r--r--app/controllers/projects/boards_controller.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index 0035633b774..56bc54fbd1c 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -1,9 +1,18 @@
class Projects::BoardsController < Projects::ApplicationController
include IssuableCollections
-
- respond_to :html
- before_action :authorize_read_board!, only: [:show]
+ before_action :authorize_read_board!, only: [:index, :show]
+
+ def index
+ @boards = ::Boards::ListService.new(project, current_user).execute
+
+ respond_to do |format|
+ format.html
+ format.json do
+ render json: @boards.as_json(only: [:id, :name])
+ end
+ end
+ end
def show
::Boards::CreateService.new(project, current_user).execute