mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
move autocomplete controllers
This commit is contained in:
1 parent
077eab7005
commit
8bef75e570
7 files changed
+51
-55
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TemplateFoldersAutocompleteController < ApplicationController
|
||||
load_and_authorize_resource :template_folder, parent: false
|
||||
|
||||
LIMIT = 100
|
||||
|
||||
def index
|
||||
template_folders = @template_folders.joins(:templates).where(templates: { archived_at: nil }).distinct
|
||||
template_folders = TemplateFolders.search(template_folders, params[:q]).limit(LIMIT)
|
||||
|
||||
render json: template_folders.as_json(only: %i[name archived_at])
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user