add template api folder filters

This commit is contained in:
Pete Matsyburka
2023-11-29 20:23:35 +02:00
parent 2cda9cd736
commit 30c913b54f
2 changed files with 5 additions and 0 deletions
@@ -9,6 +9,7 @@ module Api
templates = params[:archived] ? templates.archived : templates.active
templates = templates.where(application_key: params[:application_key]) if params[:application_key].present?
templates = templates.joins(:folder).where(folder: { name: params[:folder] }) if params[:folder].present?
templates = paginate(templates.preload(:author, documents_attachments: :blob))