summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-05 17:08:55 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-11 11:39:05 -0300
commit723ed9cc3a76f7ce0e2d1b358a33d05fb05865c9 (patch)
tree57c6f00dbcf7ab928392d82ea10bcb7313b1a04f /app
parentecf4c10e9c395604583820ad01167db34d09d4aa (diff)
downloadgitlab-ce-723ed9cc3a76f7ce0e2d1b358a33d05fb05865c9.tar.gz
Update Projects::BoardsController#show to look up for a specific board
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/boards_controller.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index 56bc54fbd1c..bbb1b1bf1e1 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -9,13 +9,20 @@ class Projects::BoardsController < Projects::ApplicationController
respond_to do |format|
format.html
format.json do
- render json: @boards.as_json(only: [:id, :name])
+ render json: serialize_as_json(@boards)
end
end
end
def show
- ::Boards::CreateService.new(project, current_user).execute
+ @board = project.boards.find(params[:id])
+
+ respond_to do |format|
+ format.html
+ format.json do
+ render json: serialize_as_json(@board)
+ end
+ end
end
private
@@ -23,4 +30,8 @@ class Projects::BoardsController < Projects::ApplicationController
def authorize_read_board!
return access_denied! unless can?(current_user, :read_board, project)
end
+
+ def serialize_as_json(resource)
+ resource.as_json(only: [:id, :name])
+ end
end