Add API to boards
This commit is contained in:
committed by
Stanko K.R.
parent
728fe7c243
commit
ea697b7143
@@ -1,9 +1,13 @@
|
||||
class BoardsController < ApplicationController
|
||||
include FilterScoped
|
||||
|
||||
before_action :set_board, except: %i[ new create ]
|
||||
before_action :set_board, except: %i[ index new create ]
|
||||
before_action :ensure_permission_to_admin_board, only: %i[ update destroy ]
|
||||
|
||||
def index
|
||||
@boards = Current.user.boards
|
||||
end
|
||||
|
||||
def show
|
||||
if @filter.used?(ignore_boards: true)
|
||||
show_filtered_cards
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
json.cache! board do
|
||||
json.(board, :id, :name, :all_access)
|
||||
json.created_at board.created_at.utc
|
||||
json.url board_url(board)
|
||||
|
||||
json.creator do
|
||||
json.partial! "users/user", user: board.creator
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @boards, partial: "boards/board", as: :board
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! "boards/board", board: @board
|
||||
Reference in New Issue
Block a user