summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-02 21:19:13 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 12:58:58 -0300
commit296bcbd6640ddeb06093c2505ed749be07362975 (patch)
tree7864e4b47b6080f1128ac16dea9dc4d66d16bc19 /app/controllers
parent52b6a7e966670fd7320dc821d11311f50b3725e7 (diff)
downloadgitlab-ce-296bcbd6640ddeb06093c2505ed749be07362975.tar.gz
Add endpoint to list issues for a specific board list
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/board_issues_controller.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/projects/board_issues_controller.rb b/app/controllers/projects/board_issues_controller.rb
new file mode 100644
index 00000000000..fb77270adda
--- /dev/null
+++ b/app/controllers/projects/board_issues_controller.rb
@@ -0,0 +1,22 @@
+class Projects::BoardIssuesController < Projects::ApplicationController
+ respond_to :json
+
+ rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
+
+ def index
+ issues = Boards::Issues::ListService.new(project, current_user, filter_params).execute
+ issues = issues.page(params[:page])
+
+ render json: issues.as_json(only: [:id, :title, :confidential], include: { labels: { only: [:id, :title, :color] } })
+ end
+
+ private
+
+ def filter_params
+ params.permit(:list_id)
+ end
+
+ def record_not_found(exception)
+ render json: { error: exception.message }, status: :not_found
+ end
+end