summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-05 16:24:29 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-11 11:39:05 -0300
commitecf4c10e9c395604583820ad01167db34d09d4aa (patch)
tree7734ebceb1167832606dcc5463caacc9d0bb4460 /app
parentb4b8e0ec9405c4b5d17b53552612397e847e734d (diff)
downloadgitlab-ce-ecf4c10e9c395604583820ad01167db34d09d4aa.tar.gz
Add index action to Projects::BoardsController to return project boards
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/boards_controller.rb15
-rw-r--r--app/views/projects/boards/index.html.haml0
2 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
diff --git a/app/views/projects/boards/index.html.haml b/app/views/projects/boards/index.html.haml
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/app/views/projects/boards/index.html.haml