share template only hosted

This commit is contained in:
Pete Matsyburka committed 2024-02-26 18:02:24 +02:00
1 parent 57c7dc1b5e
commit f83674b934
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -54,10 +54,14 @@ class DashboardController < ApplicationController
rel = templates.active.preload(:author).order(id: :desc)
if params[:q].blank?
shared_template_ids =
TemplateSharing.where(account_id: [current_account.id, TemplateSharing::ALL_ID]).select(:template_id)
if Docuseal.multitenant?
rel = rel.where(folder_id: current_account.default_template_folder.id)
else
shared_template_ids =
TemplateSharing.where(account_id: [current_account.id, TemplateSharing::ALL_ID]).select(:template_id)
rel = rel.where(folder_id: current_account.default_template_folder.id).or(rel.where(id: shared_template_ids))
rel = rel.where(folder_id: current_account.default_template_folder.id).or(rel.where(id: shared_template_ids))
end
end
Templates.search(rel, params[:q])