add slug filter

This commit is contained in:
Pete Matsyburka
2025-04-15 13:22:02 +03:00
parent d1cfc64adc
commit 67be785e69
3 changed files with 31 additions and 20 deletions
@@ -90,6 +90,7 @@ module Api
templates = params[:archived].in?(['true', true]) ? templates.archived : templates.active
templates = templates.where(external_id: params[:application_key]) if params[:application_key].present?
templates = templates.where(external_id: params[:external_id]) if params[:external_id].present?
templates = templates.where(slug: params[:slug]) if params[:slug].present?
templates = templates.joins(:folder).where(folder: { name: params[:folder] }) if params[:folder].present?
templates