fix: Remove draft articles from the help center search (#10116)

Limit the API to return only the published articles in public help
center API.

Fixes https://github.com/chatwoot/chatwoot/issues/10026
This commit is contained in:
Pranav
2024-09-16 15:47:44 +05:30
committed by GitHub
parent 73d448a203
commit b9ff164041
2 changed files with 9 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ class Public::Api::V1::Portals::ArticlesController < Public::Api::V1::Portals::B
layout 'portal'
def index
@articles = @portal.articles
@articles = @portal.articles.published
search_articles
order_by_sort_param
@articles.page(list_params[:page]) if list_params[:page].present?