mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 15:22:33 -05:00
add folders structure
This commit is contained in:
1 parent
f8712a9da9
commit
380f553a17
30 files changed
+405
-56
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
class TemplateFoldersAutocompleteController < ApiBaseController
|
||||
load_and_authorize_resource :template_folder, parent: false
|
||||
|
||||
LIMIT = 100
|
||||
|
||||
def index
|
||||
template_folders = @template_folders.joins(:templates).where(templates: { deleted_at: nil }).distinct
|
||||
template_folders = TemplateFolders.search(template_folders, params[:q]).limit(LIMIT)
|
||||
|
||||
render json: template_folders.as_json(only: %i[name deleted_at])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user