fix(captain): cap FAQ source previews

This commit is contained in:
aakashb95
2026-07-14 23:15:08 +05:30
parent 44ad817fb3
commit 2e84ebb4de
@@ -5,6 +5,7 @@ class Api::V1::Accounts::Captain::FaqSuggestionsController < Api::V1::Accounts::
before_action :set_suggestion, except: [:index]
RESULTS_PER_PAGE = 25
SOURCE_PREVIEW_LIMIT = 50
def index
@current_page = permitted_params[:page] || 1
@@ -17,6 +18,8 @@ class Api::V1::Accounts::Captain::FaqSuggestionsController < Api::V1::Accounts::
@observations = @suggestion.observations
.where(conversation_id: accessible_conversations.select(:id))
.includes(:conversation)
.order(created_at: :desc)
.limit(SOURCE_PREVIEW_LIMIT)
end
def update