2023-04-21 21:25:52 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Navigator
|
|
|
|
class ProjectFoldersController < BaseController
|
|
|
|
before_action :load_project_folder
|
|
|
|
|
|
|
|
def show
|
2023-06-22 21:41:37 +08:00
|
|
|
folder = project_level_branch(@project_folder)
|
2023-04-21 21:25:52 +08:00
|
|
|
render json: { items: folder }
|
|
|
|
end
|
|
|
|
|
|
|
|
def tree
|
2023-06-22 21:41:37 +08:00
|
|
|
tree = project_level_branch(@project_folder)
|
2023-05-24 17:04:12 +08:00
|
|
|
tree = build_folder_tree(@project_folder, tree)
|
2023-04-21 21:25:52 +08:00
|
|
|
render json: { items: tree }
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def load_project_folder
|
|
|
|
@project_folder = current_team.project_folders.find_by(id: params[:id])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|